Azure DevOps
Integrating Azure DevOps with Arcus by Testsigma uploads your JUnit test results to a test run at the end of a pipeline run, so test case statuses update automatically.
Prerequisites
Store the API token in Azure DevOps
Section titled “Store the API token in Azure DevOps”The pipeline reads the token from a pipeline variable named TESTSIGMA_API_TOKEN, so add it in Azure DevOps and mark it as a secret.
Configure the pipeline
Section titled “Configure the pipeline”-
In Azure DevOps, open your pipeline.
-
Click Edit in the top right.
-
Replace the contents of
azure-pipelines.ymlwith the following, then replace the 2 placeholders as described below.
trigger: - master
pool: vmImage: ubuntu-latest
variables: TESTSIGMA_API_TOKEN: $(TESTSIGMA_API_TOKEN)
steps: - task: Maven@3 inputs: mavenPomFile: 'pom.xml' mavenOptions: '-Xmx3072m' javaHomeOption: 'JDKVersion' jdkVersionOption: '1.8' jdkArchitectureOption: 'x64' publishJUnitResults: true testResultsFiles: '**/surefire-reports/TEST-*.xml' goals: 'package' continueOnError: true displayName: 'Build and test with Maven'
- bash: | 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/report.xml" env: TESTSIGMA_API_TOKEN: $(TESTSIGMA_API_TOKEN) displayName: 'Upload test results to Testsigma'- 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. For a Maven build this is undersurefire-reports. - Change
masterundertriggerif your target branch is named something else.
Trigger a build
Section titled “Trigger a build”In your Azure DevOps pipeline, click Run pipeline.
When the build finishes, the test run in Arcus by Testsigma updates with the execution results.
Was this page helpful?
Thanks for the feedback.