Jenkins
Running your tests in CloudBeat from Jenkins pipeline
Last updated
Running your tests in CloudBeat from Jenkins pipeline
Last updated
You can easily trigger and run tests in CloudBeat inside your Jenkins pipeline using the guide below.
CloudBeat takes the hassle of parallelizing and scaling your tests in Jenkins, grouping test results and allowing to see the test reports inside Jenkins.
We recommend to use Project Parameters to store CloudBeat's API Key. This will allow to centrally managed CloudBeat related credentials and share the API Key between multiple CloudBeat CLI invocations.
To add CloudBeat's API Key as project parameter, complete the following steps:
Go to configure page of your current build.
In General Tab , tick 'This project is parametrized'.
Fill in the name of the key, and value. Below is an example of specifying CloudBeat's user API Key:
NOTE: API Key can be found in My Settings -> Security screen. See General Settings for more details.
In order to trigger your tests from Jenkins, you will need to use CloudBeat CLI. You need to add the below steps right at the point where you want your tests to be executed.
Go to your Jenkins build and add two Execute Shell build steps:
Add the following Command in the first added step in order to install CloudBeat CLI as NPM module (Node.js installation is require prior to this step execution):
In the second added step, enter CloudBeat CLI start
command with related arguments. Here is an example of CloudBeat CLI command that runs a specified test case:
Node.js 16 or above must be installed in your Jenkins or Docker environment before running npm install command.
You can find more details on various CloudBeat CLI commands and argument here.
Exit code can be controlled with --fail-on-errors
(true or false). Default is true. For example --fail-on-errors=true
You can see full error using debug mode --debug
(true or false). Default is false. For example --debug=true
In order to get a test report in Jenkins when the test run is finished, you need to add the following post-build action:
You can also see the full test report inside CloudBeat UI, which will include test summary insights, detailed execution steps, performance metrics, various logs and AI-driven failure root-cause analysis.