Adding post-build steps to automatically submit build and automated test results from Jenkins to Helix ALM
To automatically submit automated test results from Jenkins to Helix ALM, you need to add a post-build step to your Freestyle project or Pipeline with information about where to find the report files that are parsed after a build, where to put the data in Helix ALM, and additional information to submit.
1. If you need to create a project, go to the Dashboard in Jenkins and click New Item.
If you have an existing project to use, add the post-build action to it. Skip to step 6.
2. Enter a project name in the Enter an item name field.
3. Click Freestyle project.
4. Click OK.
5. Configure the project. See the Jenkins help for information.
6. Click the Post-build Actions tab.
7. Click Add post-build action and select Helix ALM Test Results Reporting.
A new Helix ALM Test Results Reporting section is added to the Post-build Actions section.
8. Select the Helix ALM connection that contains the project to submit test results to. If you need to add a connection, see Configuring a Helix ALM REST API Server connection.
9. Select the Project to submit test results to.
10. Select the Automation suite to submit test results to. If the suite is not available in the list, you may need to add it in Helix ALM first. See Adding automation suites.
11. Enter the location where the Test report files will be stored. When you run a suite, an XML file is generated and must be saved in the specified locations.
This is the base directory and comma- or space-separated list of patterns of files to include as test results. The first time you run a build in Jenkins, a folder is created in the workspace root. If you will use that folder for reports, enter *.xml
in the field. If reports are saved in another location, such as a file share, you need to specify the full path. For example, myproject/target/test-reports/*.xml
. JUnit and xUnit XML files are supported.
12. Select the Report file format for the test results. JUnit and xUnit are supported.
13. Select Show optional settings and enter or select any of the settings.
- Test run set – Select the test run set to group the tests un. The list includes test run sets configured in the selected Helix ALM project.
- Build description – Enter a description of the Jenkins build to submit to Helix ALM.
- Branch – Enter info about the Jenkins build branch to submit to Helix ALM.
14. Click Add post-build action to add another post-build action. For example, you may need to do this if you want to submit test results to another automation suite in Helix ALM.
15. Click Save when you finish.
1.If you need to create a Pipeline, go to the Dashboard in Jenkins and click New Item.
If you have an existing Pipeline to use, add the post-build action to it. Skip to step 6.
2. Enter a project name in the Enter an item name field.
3. Click Pipeline.
4. Click OK.
5. Configure the pipeline. See the Jenkins help for information.
6. Click the Advanced Project Options tab.
7. Go to the Pipeline section.
8. Select Pipeline script as the Definition.
9. Click Pipeline Syntax to generate a pipeline script that you can copy and paste into the pipeline.
Tip: If you want to manually write the script, enter it in the Script field and skip to step 16. See Helix ALM pipeline script syntax and Example Helix ALM pipeline script for information.
10. Click Snippet Generator.
11. Select halm_report: Helix ALM Test Results Reporter as the Sample Step.
Helix ALM fields are displayed.
12. Select the Helix ALM connection that contains the project to submit test results to. If you need to add a connection, see Configuring a Helix ALM REST API Server connection.
13. Select the Project to submit test results to.
14. Select the Automation suite to submit test results to. If the suite is not available in the list, you may need to add it in Helix ALM first. See Adding automation suites.
15. Enter the location where the Test report files will be stored. When you run a suite, an XML file is generated and must be saved in the specified locations.
This is the base directory and comma- or space-separated list of patterns of files to include as test results. The first time you run a build in Jenkins, a folder is created in the workspace root. If you will use that folder for reports, enter *.xml
in the field. If reports are saved in another location, such as a file share, you need to specify the full path. For example, myproject/target/test-reports/*.xml
. JUnit and xUnit XML files are supported.
16. Select the Report file format for the test results. JUnit and xUnit are supported.
17. Select Show optional settings and enter or select any of the settings.
- Test run set – Select the test run set to group the tests un. The list includes test run sets configured in the selected Helix ALM project.
- Build description – Enter a description of the Jenkins build to submit to Helix ALM.
- Branch – Enter info about the Jenkins build branch to submit to Helix ALM.
18. Click Generate Pipeline Script.
A pipeline script that contains the Helix ALM information is generated.
19. Copy the script.
20. Go back to the Pipeline section on Advanced Project Options tab in the pipeline.
21. Paste the script in the Script field.
22. Click Save to save the changes.
Helix ALM pipeline script syntax
Field name | Required or optional | Type | Description | Example |
---|---|---|---|---|
automationSuiteID | Must specify either automationSuiteID or automationSuite |
numeric | Record ID for the automation suite in Helix ALM | automationSuiteID: 2,
|
automationSuite | Must specify either automationSuiteID or automationSuite |
string | Name for the automation suite in Helix ALM | automationSuite: 'Suite Name',
|
branch | Optional | string | Information about the Jenkins build branch to submit to Helix ALM. Displayed as the 'branch' property for builds in Helix ALM. | branch: 'Mainline',
|
description | Optional | string | Description of the Jenkins build to submit to Helix ALM | description: 'Pipeline',
|
halmConnectionID | Required | string | Name or UUID of the connection specified in the Helix ALM REST API connection configuration in Jenkins. | halmConnectionID: '920b579f-c6f6-45c9-bf3e-352c85c7c3da',
|
projectID | Required | string | Name, record ID, or UUID for the Helix ALM project to submit results to. | projectID: '{57c31d7b-fead-45d7-b812-5a6e0026e68b}',
|
testFileFormat | Required | numeric | Test report file format. Values: 0 - JUnit, 1 - xUnit. | testFileFormat: '1',
|
testFilePattern | Required | string | Wildcard text that specifies the set of test result report files. For example, halm-rest-client/build/test-results/test/TEST-com.wysicorp.halm.*.xml . |
testFilePattern: '*.xml',
|
testRunSetID | Optional | numeric | RecordID for the test run set used to group the results in Helix ALM. Can use this or testRunSet . |
testRunSetID: 2
|
testRunSet | Optional | string | Name for the test run set used to group the results in Helix ALM. Can use this or testRunSetID . |
testRunSetID: 'Alpha'
|
Example Helix ALM pipeline script
halm_report automationSuiteID: 2, branch: 'Mainline', description: 'Pipeline', halmConnectionID: '920b579f-c6f6-45c9-bf3e-352c85c7c3da', projectID: '{57c31d7b-fead-45d7-b812-5a6e0026e68b}', testFileFormat: '1', testFilePattern: '*.xml', testRunSetID: 2
What to do next
Next, modify your test scripts to include information required to associate test results with test cases in Helix ALM and provide additional information about builds and tests in results reports. See Automatically associating automated test results with test cases.