Jenkins and ALM Integration
Team use Jenkins to implement CI pipelines. These pipeline typically contain stages for running unit or integration tests using a variety of testing frameworks or tools like JUnit with Selenium, Python with Playwright, etc. The Bumblebee Plugin for Jenkins enables user to easily configure these pipeline stages to send test results to ALM via the Bumblebee server. The Bumblebee Jenkins plugin is able to parse a variety of reporting formats, extract useful data, and map them to appropriate fields in ALM without any changes to the test code.
Installation
Install Bumblebee Jenkins plugin from Jenkins update center
Configure the Bumblebee Jenkins: Manage Jenkins → Configure System → Bumblebee Plugin
Bumblebee Jenkins plugin exposes a variety of options within the Jenkins Job to enable a variety of interactions with ALM.
Test Results Processor
Bumblebee is able to process a variety of test framework reporting schemas such as JUnit, TestNG, NUnit, Cucumber, Robot, and seamlessly upload them to ALM. Add the Bumblebee ALM Uploader
post-build action
and configure the step per your ALM integration needs
Jenkins Pipeline
step([$class: 'BumblebeePublisher',
configs:[[
domain: 'DEFAULT',
projectName: 'demo',
testPlan: 'Subject\\testPlan',
testLab: 'Root\\testLab',
testSet : 'testSet',
format: 'JUNIT',
resultPattern:'**/surefire-reports/*.xml',
customProperties:'key=value',
failIfUploadFailed: false,
offline: false]],
])
ALM custom fields that are configured on the Bumblebee Server XML mappings, can be specified in the custom properties field as name-value pairs.
Bumblebee ALM Uploader Field Reference
Field Name | Required | Description |
---|---|---|
Domain | Yes | The name of ALM domain where to export test results |
Project | Yes | The name of ALM project |
Test Plan | Yes | TestPlan path in ALM where tests should be saved. Must start with Subject\ |
Test Lab | Yes | TestLab path in ALM where test results should be saved. Must start with Root\ |
Test Set | Yes | The name of test set in ALM |
Format | Yes | Format of test results generated by previous tasks in the same job. Available values: junit, nunit, testng, cucumber, serenity, jbehave |
Results File Pattern | Yes | Provide path to the XML file(s) generated during the build.This is a comma separated list of test result directories.You can also use Ant style patterns such as **/surefire-reports/*.xml |
HP ALM Mappings | No | If ALM Mappings are configured on the Bumblebee server, their values can be specified in this field.The format is [alm field label 1]=[value 1] , [alm field label 2]=[value 2] . The label values can be Jenkins environment variables. You can also directly specify the default value on the Bumblebee server. Please refer to Bumblebee server documentation for details on configuring HP ALM mappings. |
Fail build if upload unsuccessful | N/A | If checked, the build will be marked as failed if for any reason the plugin was not able to upload the results. This could be due to Bumblebee server issues, HP ALM server issues, network issues, etc. |
Process offline | N/A | If checked, Bumblebee will send test reports to be processed in a background thread on the Bumblebee server. This option is useful if you notice a large increase in build time due to Bumblebee's real-time test results processing. |
When the Jenkins job is run, the build log will show useful information about Bumblebee server activity. The test results will be processed by Bumblebee server and corresponding TestPlan, TestLab, Testset, and TestRun will be created automatically.
Defect Management
Triaging Jenkins build failures and viewing test results reports in Jenkins can be a very time consuming exercise. If this is not done in a timely manner, defect may not be reported on time. Bumblebee Jenkins plugin allows user to automatically create and resolve defect in ALM using a variety of configurable rules and policies.
Add the HP ALM Uploader
post-build action
and configure the Defect Management
section per your defect management workflow.
Bumblebee Defect Managment Configuration
Field Name | Description |
---|---|
Defect Create Policy | Create: Creates a new defect for failing test or updates existing tests whose status is New, Open or Reopen. Reopen: Creates a new defect for failing test or reopens the existing one |
Create Status | Status in ALM which will be assigned to a newly created defect |
Create Defect Mappings | Set of properties which will be set to a newly created defect. The format is as follows: [alm field label]=[value] . Each name/value pair must start with the new line. ALM field labels must be configured on Bumblebee Server Bumblebee Server |
Reopen Status | Status in ALM which will be assigned to a reopened defect. Effective only if create policy is Reopen |
Reopen Defect Mappings | Set of properties which will be set to a reopened defect. The format is as follows: [alm field label]=[value] . Each name/value pair must start with the new line. ALM field labels must be configured on Bumblebee Server |
Severity | Value for Severity property of defect |
Defect Resolve Policy | If set to Close , Bumblebee will search for an existing defects with Bumblebee prefix for passed tests and resolve them |
Resolve Status | Status in ALM which will be assigned to a resolved defect |
Resolve Defect Mappings | Set of properties which will be set to a resolved defect. The format is as follows: [alm field label]=[value] . Each name/value pair must start with the new line. ALM field labels must be configured on Bumblebee Server |
Jenkins Pipeline
step([$class: 'BumblebeePublisher',
configs:[[
domain: 'DEFAULT',
projectName: 'demo',
testPlan: 'Subject\\defcts',
testLab: 'Root\\defects',
testSet : 'defects',
format: 'cucumber',
resultPattern:'target/*.json',
defectCreatePolicy: 'REOPEN',
defectCreateStatus: 'Open',
defectSeverity: "1-Low",
defectReopenStatus: "Open",
defectResolvePolicy: "CLOSE",
defectResolveStatus: "Closed",
defectCreateProperties: "defect parameter=Created from Jenkins\ndefect project=Test\ndefect priority=2-Medium",
defectReopenProperties: "defect parameter=Reopened from Jenkins",
defectResolveProperties: "defect parameter=Closed from Jenkins",
failIfUploadFailed: false,
offline: false]],
])