This page describes how to configure a PHPUnit executable for a 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. |
On this page: |
Configuring a PHPUnit Executable for a Task
Before you begin:
- 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:
- Navigate to the Task configuration for the Job (this will be the default Job if creating a new Plan).
- 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.
- Update the Task settings:
- '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.
- If required, update the system environment variables and working directory settings:
- 'Environment Variables' (Optional) — Specify any additional* operating system environment variables you want to pass to your build; Please note, multiple variables must be separated with spaces, and parameters with spaces must be quoted (e.g 'ANT_OPTS=-Xms200m -Xmx700m'). You can also include Bamboo global or build-specific variables (see Using Global, Plan or Build-specific Variables).
* i.e. additional to the existing environment variables (see Viewing Bamboo's System Information for a list). Note that existing environment variables are automatically available to the executable, thus you don't need to specify them in the 'System Environment Variables' field. - 'Working Sub Directory' (Optional) — A subdirectory relative to the Job build's root directory where Bamboo will execute your specified executable's commands. The Job build's root directory contains everything checked out from your Job's configured source repository. If you leave this field blank, Bamboo will look for the build files in the build root directory (which is assumed to be the Working Directory, as described in Locating Important Directories and Files). This option is useful, if your Task has a build script in a subdirectory and the executable needs to be run from within that subdirectory, in which case, you would type the name of that subdirectory in this field.
- 'Environment Variables' (Optional) — Specify any additional* operating system environment variables you want to pass to your build; Please note, multiple variables must be separated with spaces, and parameters with spaces must be quoted (e.g 'ANT_OPTS=-Xms200m -Xmx700m'). You can also include Bamboo global or build-specific variables (see Using Global, Plan or Build-specific Variables).
- Update the following build parameters:
- 'Log test execution to XML file' — Select this check box if you want PHPUnit to record test results in JUnit format.
This format is also used by TestNG. If you select this check box, the following field is displayed:
- 'Test Result File' — Enter the location of the file to record JUnit test results.
- 'Generate code coverage report in HTML format' — Select this check box if you want PHPUnit to generate code coverage data in HTML format (e.g. for PHPUnit HTML Code Coverage reports). If you select this check box, the following field is displayed:
- 'HTML Code Coverage Directory' — Enter the location of the directory to record HTML coverage data.
- 'Log test execution to XML file' — Select this check box if you want PHPUnit to record test results in JUnit format.
- Click the 'Save' button to save your changes.