Skip to content

Commit 2fb92e9

Browse files
authored
Updated Azure DevOps doc (#1045)
* Updated Azure DevOps doc * step edit
1 parent 8f990b8 commit 2fb92e9

1 file changed

Lines changed: 64 additions & 35 deletions

File tree

src/pages/docs/continuous-integration/azure-devops.md

Lines changed: 64 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,90 @@ title: "Integrate Testsigma with Azure DevOps"
33
order: 13.14
44
metadesc: "How to integrate Testsigma with Azure DevOps"
55
noindex: false
6-
page_id: "How to Create a Test Plans to run on Local Devices"
6+
page_id: "Integrate Testsigma with Azure DevOps"
77
search_keyword: "Azure DevOps, Integrations, CI/CD"
88
warning: false
99
contextual_links:
1010
- type: section
1111
name: "Contents"
1212
- type: link
13-
name: "Prerequisites:"
13+
name: "Prerequisites"
1414
url: "#prerequisites"
1515
- type: link
16-
name: "How to integrate with Azure DevOps"
17-
url: "#how-to-integrate-with-azure-devops"
16+
name: "Prepare the Shell Script"
17+
url: "#prepare-the-shell-script"
18+
- type: link
19+
name: "Create the Azure DevOps Pipeline"
20+
url: "#create-the-azure-devops-pipeline"
21+
- type: link
22+
name: "Run the Pipeline and View Results"
23+
url: "#run-the-pipeline-and-view-results"
1824
---
1925

2026
---
2127

22-
Microsoft Azure, aka Azure, is a cloud computing service created by Microsoft for building, testing, deploying, and managing applications and services through Microsoft-managed data centers.
28+
Integrate Testsigma with Azure DevOps to trigger Test Plan executions from your CI/CD pipeline. Azure DevOps runs a shell script that calls the Testsigma API to start a Test Plan and fetch its results.
2329

2430
---
2531

2632
> <p id="prerequisites">Prerequisites</p>
2733
>
2834
> Before you begin, ensure that you have referred to:
29-
> 1. [Documentation on generating API keys](https://testsigma.com/docs/configuration/api-keys/).
30-
> 2. <a href="https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/get-test-plan-id.png" rel="nofollow">Documentation on getting test plan ID</a>.
35+
> 1. [Documentation on generic Shell script](https://testsigma.com/docs/continuous-integration/shell-script/) to get the script file.
36+
> 2. [Documentation on generating API keys](https://testsigma.com/docs/configuration/api-keys/).
37+
> 3. [Documentation on getting test plan ID](https://testsigma.com/docs/continuous-integration/get-test-plan-details/).
3138
3239
---
33-
## **How to integrate with Azure DevOps**
34-
1. Login to the Azure DevOps account and create a **Project**. Navigate to Pipelines and click on the **New Pipeline** to get started.
40+
41+
## **Prepare the Shell Script**
42+
43+
1. Copy the Unix shell script from the [documentation on generic Shell script](https://testsigma.com/docs/continuous-integration/shell-script/).
44+
45+
[[info | NOTE:]]
46+
| Use the Unix shell script if your system runs macOS or Linux. Use the script under **For Powershell Script** on the same page if your system runs Windows.
47+
48+
2. Generate an API key from **Configurations > API Keys**. The link is mentioned in the prerequisites.
49+
50+
3. Get the Test Plan ID from the **CI/CD Integrations** tab on the Test Plan details page. The link is mentioned in the prerequisites.
51+
52+
4. Replace **TESTSIGMA\_API\_KEY** and **TESTSIGMA\_TEST\_PLAN_ID** in the script with the values from steps 2 and 3.
53+
![shell script for Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/shell-script-azure-devops.png)
54+
55+
5. Save the script in the code repository that you'll use for the Azure DevOps pipeline. Name it **cicd-api.sh**.
56+
57+
[[info | NOTE:]]
58+
| This script triggers the Test Plan execution and returns the result once the run is complete.
59+
60+
---
61+
62+
## **Create the Azure DevOps Pipeline**
63+
64+
1. Sign in to your Azure DevOps account.
65+
66+
2. Create a **Project**.
67+
68+
3. Navigate to **Pipelines** and click **New Pipeline**.
3569
![create new pipeline azure devops](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/create-new-pipeline-azure-devops.png)
3670

37-
2. Choose the **Version Control System** (VCS) where your application code is stored.
71+
4. Select the version control system (VCS) where your code repository, including **cicd-api.sh**, is stored.
3872
![select version control system in Azure Devops](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/select-version-control-system-azure-devops.png)
3973

40-
4174
[[info | NOTE:]]
42-
| In order to integrate with Azure, you need to have a YAML file in your Code repository. This file contains the details for the CI/CD Integration with Azure DevOps. If not available yet, Azure has an option in which it will create a sample YAML file in your repository once access is given.
75+
| Azure DevOps requires a YAML file in your code repository to configure the CI/CD pipeline. If your repository doesn't have one, Azure DevOps creates a sample YAML file in your repository once you grant access.
4376

44-
3. Choose the repository where your Configuration YAML file is present. Once you select your repository it will take you to the configuration page where you can configure your pipeline.
77+
5. Select the repository that contains your configuration YAML file.
4578
![select repository in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/select-repository-azure-devops.png)
46-
47-
4. On **Configure your pipeline** page, if you already have your YAML file in your repo, you can select the option **Existing Azure Pipeline YAML file**. Otherwise, you can select **Starter Pipeline** to create a sample YAML file in the selected repository.
48-
![configure your pipeline page in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/configure-your-pipeline-azure-devops.png)
49-
5079

51-
In this case, we already had an existing YAML file in the repo. So, once you select the fourth option in the above image, it will take you to a place where you need to enter the branch and path of the YAML file in your repository.
52-
![Select existing pipeline while configuring an existing YAML file in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/configure-pipeline-select-yaml-file-azure-devops.png)
80+
6. On the **Configure your pipeline** page, select **Existing Azure Pipelines YAML file** if your repository already has one, or select **Starter pipeline** to create a sample file.
81+
![configure your pipeline page in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/configure-your-pipeline-azure-devops.png)
5382

83+
**(If using an existing file)**: Enter the branch and path of the YAML file in your repository.
84+
![Select existing pipeline while configuring an existing YAML file in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/configure-pipeline-select-yaml-file-azure-devops.png)
5485

55-
5. Review the CI Configuration after selecting the Branch and Path, click on **Continue**.
86+
7. Review the CI configuration, then click **Continue**.
5687
![Review CI configuration in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/review-ci-configuration-azure-devops.png)
5788

58-
The YAML file contains the following code where you need to enter the filePath of the Generic Shell Script (cicd-api.sh) to run it. For more information on generic shell script, refer to the [documentation generic shell script](https://testsigma.com/docs/continuous-integration/shell-script/). This Shell script is the one that actually triggers the Test Plan execution and gives you the result of Test plan once it's complete.
89+
8. In the YAML file, enter the path to **cicd-api.sh** in the `filePath` field:
5990

6091
```yaml
6192
# Azure Pipelines YAML file
@@ -69,9 +100,9 @@ steps:
69100
displayName: Run a one-line script
70101

71102
- task: Bash@3
72-
displayName: Run Shell Script (./cd-api.sh)
103+
displayName: Run Shell Script (./cicd-api.sh)
73104
inputs:
74-
filePath: ./cd-api.sh
105+
filePath: ./cicd-api.sh
75106

76107
- task: PublishTestResults@2
77108
displayName: publish test-results
@@ -80,28 +111,26 @@ steps:
80111
testResultsFiles: '**/*junit-report.xml'
81112
```
82113
114+
---
83115
84-
85-
In order to Trigger a particular test plan, you just need to add your own Test plan Execution id and the API key in the Shell Script (cicd-api.sh). As shown below:
86-
![shell script for Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/shell-script-azure-devops.png)
87-
88-
For more information on configuration of Generic Shell Script, refer to https://testsigma.com/docs/continuous-integration/shell-script/.
116+
## **Run the Pipeline and View Results**
89117
90-
6. Test the configuration once the script is set up and reviewed for the pipeline, and click on the **Run** to start your Job.
118+
1. Click **Run** to start the pipeline job.
91119
![test configuration in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/test-configuration-azure-devops.png)
92120
93-
Once the Run is initiated, you will see this page:
121+
2. Track the run on the pipeline results page.
94122
![set up ci with Azure Pipelines](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/setup-ci-with-azure-pipelines.png)
95123
96-
Once the job has been completed, the Job status will be **Success** as shown in the image below:
124+
3. Once the job completes, the job status shows **Success**.
97125
![Job Status Success in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/job-status-success-azure-devops.png)
98126
99-
7. Once the job is completed we can see the reports in the **Test Plans > Runs**.
127+
4. Navigate to **Test Plans > Runs** to view the reports.
100128
![Test Plans Runs in Pipelines in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/pipelines-testplans-runs-azure-devops.png)
101129
102-
After clicking on **Runs** you can select the Test plan for which you want to view the report and then you will be navigated to the page below, and also you can download the JUnit report in XML format.
130+
5. Select **Runs**, then select the Test Plan whose report you want to view. Download the JUnit report in XML format from this page.
103131
![Junit report in Azure DevOps](https://s3.amazonaws.com/website-static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/junit-report-azure-devops.png)
104132
105-
You can use another shell script to convert the JUnit XML format result into an HTML format.
106-
133+
[[info | NOTE:]]
134+
| Use a separate shell script to convert the JUnit XML report into HTML format.
107135
136+
---

0 commit comments

Comments
 (0)