Use the mabl Jenkins Plugin to automatically trigger mabl plans associated with a specific mabl environment and/or application to run as a build stage.
With the mabl Jenkins Plugin, you can:
- Run mabl tests in Jenkins pipeline projects or freestyle jobs.
- Fail your Jenkins build if the mabl tests fail. Optionally, you may set the build to continue on failure.
- View mabl test results in a JUnit report
- Expose mabl results in Jenkins using the Jenkins Junit plugin
Visit the plugin repo to get full details on the plugin, lodge issues, or fork and submit pull requests.
Setup
To set up the mabl Jenkins plugin, read the instructions here.
mabl Project step
Configuring a Run mabl tests step plugin requires the following pieces of information:
- A CI/CD Integration API key - API key access is limited to workspace owners.
- mabl application and/or environment of the plans you want to run
- Optional advanced settings include plan labels and test branches.
mabl Pipeline step
To create a mabl pipeline step, you need to obtain the environment ID and/or application ID for the plans you want to run.
Note
Only enabled plans configured to run on deployment are triggered by a deployment event. If a plan is disabled or lacks a deployment trigger, it does not run as part of a deployment event.
Results
You can view plugin results in mabl or in the JUnit XML test output. JUnit tests are output to the reports.xml file in your Jenkins build directory after the mabl tests complete.
Exposing mabl results in Jenkins
You can expose mabl test results in Jenkins using the Jenkins JUnit plugin:
- Add a "Run mabl tests" action to your build
- Add a "Publish JUnit test result report" post-build action to your build
- Configure the Test report XMLs field with report.xml
- Check "Do not fail the build on empty test results"
Configured Jenkins mabl build action and JUnit test reporting
After setting up the Publish JUnit test result report post-build action, you can review mabl test results under Test Result for each build.
Detailed view of mabl test runs via JUnit result output.
Test case IDs in the JUnit report
The JUnit report.xml includes information about the test case IDs associated with the triggered tests. This report can be used to integrate your mabl test results with a test case management tool. See the article on integrating with test case management tools for more information.
Note
While test case IDs are present in the JUnit report.xml file, the test results in the Jenkins UI do not reveal test case IDs.