Integration with Bamboo
The integration between Allure TestOps and Bamboo allows you to set up the following relations:
- one job in Allure TestOps corresponds to one Bamboo plan,
- one launch of an Allure TestOps job corresponds to one Bamboo build (a sequence of Bamboo jobs).
A new Bamboo build can be triggered by either Allure TestOps or Bamboo itself, with both parties displaying its status in their web interfaces.
During the tests execution, the Allure TestOps plugin for Bamboo regularly scans for new files in the test results directory (e.g., “build/allure-results”, see Allure Report → How it works). For each new file created, the plugin waits a bit (to avoid uploading half-written files), then uploads the file to the Allure TestOps server. This way, Allure TestOps receives the test results as soon as possible and is able to show a launch's partial results even before the job is finished.
To enable Allure support on your Bamboo server:
- install the plugin for Bamboo,
- enable sending data from Bamboo,
- enable triggering Bamboo builds,
- parametrize Bamboo jobs (if necessary).
Currently, the plugin for Bamboo does not support Allure TestOps installations with self-signed certificates.
Before setting up the integration, please make sure that you use a properly signed certificate or consider making Allure TestOps available to your Bamboo server via unencrypted HTTP.
1. Install the plugin for Bamboo
In the Bamboo web interface, click the gear icon in the top right corner and select Manage apps.
Click Find new apps.
Using the search box, find the “Allure TestOps for Bamboo” plugin.
Click Install next to the plugin.
In the dialog that appears, click Install, then Accept & install.
Wait until the plugin is downloaded and installed.
2. Enable sending data from Bamboo
This section describes the second part of the two-way communication: sending job statuses and test results from Bamboo back to Allure TestOps. To configure this, any Allure TestOps user can generate an authentication token and use it in plan-level settings in Bamboo, so that Bamboo can perform actions with that user's permissions. Also, the path to the test results directory must be specified in the Bamboo job that runs tests.
2.1. Create a token in Allure TestOps
In Allure TestOps, click on your avatar and go to Your profile.
Under the API tokens section, click + Token.
Enter a Token name (e.g., “Token for Bamboo”), then click Submit.
In the dialog that appears, click the Copy icon to copy the token into clipboard.
You will need this token on the next step.
2.2. Change plan-level settings in Bamboo
On the Bamboo dashboard, go to your build plan.
Click Actions → Configure plan.
Go to the Other tab.
Under the Allure Upload section, fill in the fields:
- Enable Allure Upload — must be checked.
- Server endpoint url — the URL of the Allure TestOps server, e.g., “https://allure.example.com/”.
- Server token — the API token that you got on step 2.1.
- Project id — the name of the project in Allure TestOps.
- Launch name — a template for naming test launches. You can use Bamboo variables here.
- Launch tags — comma-separated list of tags that should be assigned to the test launch.
Click Save.
2.3. Specify test results directory
On the Bamboo dashboard, go to your build plan.
Click Actions → Configure plan.
Click on the job that runs tests.
Go to the Other tab.
In the Test Results Directories, specify the path to the test results directory, e.g., “build/allure-results”.
If there are multiple test result directories in your project, you can separate them with commas or use a wildcard pattern, e.g., “modules/*/build/allure-results”.
Click Save.
3. Enable triggering Bamboo builds
Integration with Bamboo needs to be configured on two levels.
First, the administrator specifies the URL of the Bamboo server.
Then, any project's owner adds their Bamboo credentials to an Allure TestOps project and registers jobs in Allure TestOps.
3.1. Specify Bamboo server in Allure TestOps
Log into Allure TestOps using an administrator account.
Go to Administration → Integrations.
Click + Add integration in the top right corner of the page.
In the dialog that appears, select Bamboo CI Server.
Fill in the fields:
- Name — a name to help you recognize the Bamboo server, e.g., “Bamboo production”.
- Endpoint — the URL of the Bamboo server, e.g., “https://bamboo.example.com/”.
If your Bamboo server uses a self-signed SSL certificate, check the Disable certificate validation checkbox.
Click Add integration.
3.2. Add Bamboo credentials to an Allure TestOps project
In Allure TestOps, open your project.
Go to Settings → Integrations.
Under the Available integrations, find the Bamboo integration and click Add integration next to it.
In the dialog that appears, enter the Username and Password of the Bamboo account.
Check that the credentials are correct
Click Test connection. After a few moments, a message should appear saying “Connection established”.
Click Add integration to close the dialog and save the settings.
3.3. Add new job to Allure TestOps
The easiest and most reliable way to create a Job in Allure TestOps is to execute the Bamboo pipeline once, upload the test results to Allure TestOps, and then close the created launch.
Allure TestOps will automatically create a job for the Bamboo pipeline. You’ll then need to configure the attributes described in the step 4 in the list of manual actions for job creation below.
Create new job manually
In Allure TestOps, open your project.
Go to Jobs.
Click + Job in the top right corner of the page.
In the dialog that appears, fill in the fields:
- Build server — the name of the Bamboo server that you added on step 3.1.
- Can run tests — if checked, users will be able to trigger this job from the Test cases interface.
- Job — the name of the Bamboo project. Note that you cannot add the same Bamboo project to Allure TestOps twice.
- Parameters — parameters that should be passed to Bamboo via environment variables, see Environment.
Click Submit.
3.4. Enable support for test plans in the Bamboo job
On the Bamboo dashboard, go to your build plan.
Click Actions → Configure plan.
Click on the job that runs tests.
In the job's tasks list, select the task that runs tests.
For example, in many projects it would be a “Script” task with a framework-specific command.
In the Environment variables field, enter:
ALLURE_TESTPLAN_PATH=${bamboo.ALLURE_TESTPLAN_PATH}
.Click Save.
4. Parametrize Bamboo jobs
Bamboo uses variables for passing parameters to builds. Allure TestOps integrates this feature with its own Environment concept, which lets you both set parameters for new jobs and see parameters set for jobs that were started outside Allure TestOps.
Note that it is recommended to set the same default values both in Allure TestOps and Bamboo. This means that a Bamboo build will get the same environment regardless of what triggered it.
If your Bamboo plan is configured to use multiple branches, make sure to create a “Branch” environment variable in Allure TestOps and pass it to your job. This special name will instruct Bamboo which of the plan's branches it should run.
4.1. Add global parameter names
Log into Allure TestOps using an administrator account.
Go to Administration → Environment.
For each parameter name that you want to add:
Click + Create.
Enter the name of the new parameter.
Click Submit.
4.2. Map parameters to environment variables
In Allure TestOps, open your project.
Go to Settings → Environment.
For each parameter name that you want to use:
Click + Create if the parameter is not in the list. Otherwise, click the Edit icon next to its name.
In the Mapping key field, specify the name of the environment variable.
In the Environment variable field, select the global parameter name from step 4.1.
Click Submit.
4.3. Add parameters to the job
In Allure TestOps, open your project.
Go to Jobs.
Find the job which you want to parametrize. Click
⋯
next to the job name, then select Configure.The job settings dialog will appear, containing the Parameters section.
For each parameter that you want to add, click Add and fill in the fields:
- Name — the name of the environment variable (same as the Mapping key from step 4.2).
- Value — the default value that should be used unless overriden for a specific launch.
- Environment Variable — the environment variable from step 4.1.
Click Submit.
4.4. Set the default values in Bamboo
On the Bamboo dashboard, go to your build plan.
Click Actions → Configure plan.
Go to the Variables tab.
For each parameter that you want to add:
In the Variable name field, specify the name of the environment variable (same as the Mapping key from step 4.2).
In the Value field, specify the default value that should be used unless overriden for a specific launch.
Click Add.