Jenkins
Integrating Jenkins with Arcus by Testsigma uploads your JUnit test results to a test run at the end of a build, so test case statuses update automatically.
Prerequisites
Store the API token in Jenkins
Section titled “Store the API token in Jenkins”-
On the Jenkins dashboard, click Manage Jenkins.
-
Under Security, click Credentials.
-
Under Stores scoped to Jenkins, click (global) in the Domain column.
-
On the Global credentials page, click Add Credentials.
-
In the Kind dropdown, select Secret text.
-
In Secret, enter your Arcus by Testsigma API token.
-
In ID, enter
TESTSIGMA_API_TOKEN. -
Click Create.
Configure the pipeline
Section titled “Configure the pipeline”-
On the Jenkins dashboard, click New Item.
-
In Enter an item name, enter a name for the pipeline.
-
Select Pipeline, then click OK.
-
On the Configuration page, scroll to the Pipeline section.
-
In the Definition list, select Pipeline script.
-
In Script, paste the script that follows, replacing its 2 placeholders.
pipeline { agent any environment { TESTSIGMA_API_TOKEN = credentials('TESTSIGMA_API_TOKEN') } stages { stage('Run Tests') { steps { // Run your own test script here sh './run-tests.sh' } } stage('Upload to Testsigma TMS') { steps { // The test result file must exist at the path given below sh ''' curl --location 'https://arcus.testsigma.com/api/v1/projects/<Project_ID>/junit-import/test-run/<Run_ID>' \ --header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \ --form "junit_xml=@target/test-results/test-report.xml" ''' } } }}- Replace
<Project_ID>with your project ID, which you can retrieve using the Arcus by Testsigma APIs. - Replace
<Run_ID>with the run ID, which appears in the URL when you view a test run:https://test-management.testsigma.com/ui/test_runs/<Run_ID>/. - Point
junit_xmlat the path your build writes its JUnit XML report to.
Then click Apply, and click Save.
Trigger a build
Section titled “Trigger a build”-
On the Jenkins dashboard, click the configured pipeline.
-
In the Jenkins sidebar, click Build Now.
When the build succeeds, the test case statuses in the associated test run update automatically.
Was this page helpful?
Thanks for the feedback.