Bamboo is a continuous-integration, deployment, and delivery tool from Atlassian that integrates incredibly well with Jira.
Test Management for Jira’s Bamboo integration enables you to automate tests outside Jira, run them in Bamboo during the CI/CD pipeline and have results sent back to TM4J for reporting and tracking.
To initiate the TM4J integration with Bamboo, an admin must navigate to Bamboo's Global Variables and set variable names and values for both jira_user and jira_password.
Prior to executing tests, Cucumber users with gherkin definitions in Test Management for Jira should create a script task and add the following code to enable feature files to be downloaded from TM4J. When you add the code, replace the PROJECT_KEY and JIRA_URL variables with your actual information. Optionally, you can replace the TARGET_PATH, ZIP_FILE, and AUTO_CREATE_TEST_CASES variables with your information, as well.
To transfer your test-execution results from Bamboo back to TM4J, you need to create a final script task in the job where you want to report the test results.
Depending on if you use Cucumber or JUnit, add one of the following code sets, and remember to replace the PROJECT_KEY and JIRA_URL variables with your actual information. Optionally, you can replace the PATH_FILE, ZIP_FILE, and AUTO_CREATE_TEST_CASES variables with your information, as well.
When executed properly, the script runs after the testing concludes. Regardless of whether the tests pass or fail, the build completes, and the test results are published to TM4J.
This task describes how to apply scripts in Bamboo for the TM4J integration.
1. Navigate to your Bamboo project.
2. Select the plan you want to configure.
3. On the Actions menu in the upper-right corner, click Configurations.
4. On the Tasks tab, click Add Task.
5. Search for and select the Script task type.
6. Update the field values in the Script Configuration section, as shown.
Task descriptions will vary.
7. Paste the script into the Script Body.
8. Drag the script task into the desired position.
To transfer your test-execution results from Bamboo back to TM4J, you need to drag the script into the Final Tasks section.
If you are using Cucumber, setup could not be more simple. Add Test Management for Jira annotations to your Cucumber tests, and use our pre-made script to send the results to Jira. The integration is based on the JSON output files generated by Cucumber, so this output option needs to be configured properly, as follows.
1. Configure the JSON output format for your automated tests on the TestRunner class.
Here we’ve added JUnit and Cucumber output formats:
2. Annotate your automated tests with the @TestCaseKey tag.
The @TestCase(key = "JQA-T1") annotation maps the test method to an existing test case in Test Management for Jira by matching its key. The @TestCase(name = "Sum Two Numbers") annotation adds a name to the test case. This maps this test method to an existing test case in Test Management for Jira by matching its name. If the test case doesn’t exist in Test Management for Jira, then a new one can be automatically created using this name when the results are uploaded.
Scenarios can be mapped to test cases in Test Management for Jira by using the test-case key or name as a scenario tag. For example:
Now you can run the tests with Maven test, and the Test Management for Jira test execution results file will generate in the same execution folder.