Azure DevOps
Azure DevOps triggers Testsigma test plans by running the shell script in a Bash@3 pipeline task. A PublishTestResults@2 task then publishes the JUnit report with the pipeline’s other results.
Prerequisites
- An API key and the test plan ID (CI/CD Integrations tab of the plan).
Prepare the shell script
Section titled “Prepare the shell script”-
Copy the script: take the Unix shell script from the shell script page. On Windows, use the PowerShell script from the same page instead.
-
Set the inputs: replace
TESTSIGMA_API_KEYandTESTSIGMA_TEST_PLAN_IDin the script with your values. -
Commit it: save the script as
cicd-api.shin the code repository your pipeline will use.
Create the pipeline
Section titled “Create the pipeline”-
Create a project: sign in to your Azure DevOps account and create a Project.
-
Start a pipeline: navigate to Pipelines and click New Pipeline.
-
Pick the source: select the version control system, then the repository that contains
cicd-api.shand your configuration YAML file. -
Configure the YAML: on the Configure your pipeline page, select Existing Azure Pipelines YAML file and enter its branch and path. No YAML yet? Select Starter pipeline and Azure DevOps creates a sample file in your repository once you grant access.
-
Review and edit: review the CI configuration and click Continue. Enter the path to
cicd-api.shin thefilePathfield:azure-pipelines.yml # Azure Pipelines YAML filetrigger: masterpool:vmImage: 'ubuntu-latest'steps:- script: echo Hello, world!displayName: Run a one-line script- task: Bash@3displayName: Run Shell Script (./cicd-api.sh)inputs:filePath: ./cicd-api.sh- task: PublishTestResults@2displayName: publish test-resultsinputs:testResultFormat: JUnittestResultsFiles: '**/*junit-report.xml'
Run the pipeline and view results
Section titled “Run the pipeline and view results”-
Run the job: click Run and track it on the pipeline results page. The job status shows Success when it completes.
-
View the reports: navigate to Test Plans > Runs, then select the test plan whose report you want. Download the JUnit report in XML format from this page.
Was this page helpful?
Thanks for the feedback.