Documentation for Bamboo 4.2.x. Documentation for other versions of Bamboo is available too.

This page describes how to configure a PHPUnit executable for a Bamboo task.

When creating a new job or configuring an existing one, you need to specify the tasks that will execute the job's builds. You must specify an executable for each task. If you specify an Ant, Grails or Maven executable, you will also need to choose a JDK.

When creating a new plan, you can configure the tasks for the plan's default job.

An executable is a program external to Bamboo used to automate processes. Generally, executables compile source code to generate compiled executable files (referred to as artifacts in Bamboo). Ant, Maven, MSBuild or PHPUnit are just some examples of executables that can be used as part of your build process.

New executables can be defined as capabilities in Bamboo. Once an executable has been defined in Bamboo, it can be configured as part of a task.

Configuring a PHPUnit executable for a task

始める前に

  • To use this executable, you will need to install PHPUnit and reference the path to your PHP command-line interpreter, (e.g. /usr/bin/phpunit on Ubuntu).

To configure a PHPUnit executable for a task:

  1. Navigate to the task configuration for the job (this will be the default job if creating a new plan).
  2. Click the name of the desired command task, or click Add Task and then a PHPUnit option (e.g. 'PHPUnit') if creating a new task.
  3. タスク設定の更新
    • Task Description --— Enter a description of the task, for display in Bamboo.
    • Executable — Select the PHPUnit executable that you wish to configure for this task (e.g. "PHPUnit 3.3.x" or "PHPUnit"). The executable that you select will become one of the task's capability requirements (and hence, one of the job's requirements). For details, please see Configuring a Job's Requirements.
    • Arguments — Type the name of the directory/files that will be analysed recursively by PHPUnit. The default value is "." (i.e. the working subdirectory, if specified). You must specify at least one argument.
  4. If required, update the system environment variables and working directory settings:
    環境変数

    (Optional)  Additional system environment variables that you want to pass to your build. Note that existing environment variables are automatically available to the executable. You can also include Bamboo global or build-specific variables (see Using global, plan or build-specific variables).
    Multiple variables should be separated with spaces. Parameters with spaces must be quoted (e.g ANT_OPTS="-Xms200m -Xmx700m").

    Working Sub Directory(オプション)  Bamboo が実行ファイルを実行する、ジョブのルート ディレクトリに相対的な代替サブディレクトリ。ルート ディレクトリには、ジョブの構成済みソース リポジトリから確認されたものがすべて含まれます。このフィールドを空白のまま残した場合、Bamboo はルート ディレクトリでビルド ファイルを検索します。このオプションは、サブディレクトリ内にビルド スクリプトがあり、実行可能ファイルをそのサブディレクトリ内から実行する必要がある場合に便利です。
  5. Update the following build parameters:
    • Log test execution to XML file — Select if you want PHPUnit to record test results in JUnit format. (info)This format is also used by TestNG.
      • Test Result File — Enter the location of the file to record JUnit test results.
    • Generate code coverage report in HTML format — Select if you want PHPUnit to generate code coverage data in HTML format (e.g. for PHPUnit HTML Code Coverage reports).
      • HTML Code Coverage Directory — Enter the location of the directory to record HTML coverage data.
  6. 保存をクリックします。