Skip to content

Commit 9e4d5aa

Browse files
authored
Merge pull request #95 from testsigmahq/DOC-399
Added GitLab Integration doc
1 parent b477400 commit 9e4d5aa

7 files changed

Lines changed: 126 additions & 15 deletions

File tree

src/left-nav-title.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,8 @@
169169
},
170170
"manage-clickup-tasks": {
171171
"/docs/test-management/atto/sprint-planner/manage-clickup-tasks/": "Manage ClickUp Tasks"
172+
},
173+
"gitlab": {
174+
"/docs/test-management/ci-cd-integrations/gitlab/": "GitLab"
172175
}
173176
}

src/pages/docs/test-management/ci-cd-integrations/azure-devops.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Azure DevOps Integration with Test Management'
2+
title: 'Azure DevOps Integration with Test Management by Testsigma'
33
page_title: 'Azure DevOps Integration with Test Management by Testsigma'
44
metadesc: 'Integrate Azure DevOps with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | Azure DevOps Integration with TMS by Testsigma'
55
noindex: false
@@ -74,7 +74,7 @@ Integrate Azure DevOps with Test Management by Testsigma to automate test execut
7474
# 📤 Step 2: Upload JUnit Result to Testsigma Using CURL
7575
- bash: |
7676
echo "Uploading JUnit results to Testsigma..."
77-
curl --location 'https://test-management.testsigma.com/api/v1/projects/<Project_ID>/junit-import/test-run/<Run_ID>' \
77+
curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \
7878
--header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \
7979
--form "junit_xml=@target/report.xml"
8080
env:
@@ -86,7 +86,7 @@ Integrate Azure DevOps with Test Management by Testsigma to automate test execut
8686
[[info | **NOTE**:]]
8787
| Before triggering this build, make the following updates:
8888
| - Replace `<Project_ID>` in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.
89-
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: `https://test-management.testsigma.com/ui/test_runs/<Run_ID>/`
89+
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: https://test-management.testsigma.com/ui/test_runs/{Run_ID}/
9090
| - Replace `<JUnit_Report_File>` with the actual path to your JUnit XML report file. You can find this in your surefire-reports directory.
9191

9292
---

src/pages/docs/test-management/ci-cd-integrations/circleci.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'CircleCI Integration with Test Management'
2+
title: 'CircleCI Integration with Test Management by Testsigma'
33
page_title: 'CircleCI Integration with Test Management by Testsigma'
44
metadesc: 'Integrate CircleCI with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | CircleCI Integration with TMS by Testsigma'
55
noindex: false
@@ -90,7 +90,7 @@ Integrate CircleCI with Test Management by Testsigma to automate test executions
9090
name: 📤 Upload JUnit Results to Testsigma
9191
command: |
9292
echo "Uploading JUnit results to Testsigma..."
93-
curl --location 'https://test-management.testsigma.com/api/v1/projects/<Project_ID>/junit-import/test-run/<Run_ID>' \
93+
curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \
9494
--header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \
9595
--form "junit_xml=@target/surefire-reports/TEST-MyTests.xml"
9696
@@ -108,7 +108,7 @@ Integrate CircleCI with Test Management by Testsigma to automate test executions
108108
109109
[[info | **NOTE**:]]
110110
| - Replace `<Project_ID>` in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.
111-
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: `https://test-management.testsigma.com/ui/test_runs/<Run_ID>/`
111+
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: https://test-management.testsigma.com/ui/test_runs/{Run_ID}/
112112
| - Ensure the path to the JUnit report points to the actual XML file generated by Maven.
113113

114114

src/pages/docs/test-management/ci-cd-integrations/github.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'GitHub Integration with Test Management'
2+
title: 'GitHub Integration with Test Management by Testsigma'
33
page_title: 'GitHub Integration with Test Management by Testsigma'
44
metadesc: 'Integrate GitHub with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | GitHub Integration with TMS by Testsigma'
55
noindex: false
@@ -78,14 +78,14 @@ Integrate GitHub with Test Management by Testsigma to automate test executions a
7878
- name: 📤 Upload test results to Testsigma
7979
run: |
8080
echo "Uploading JUnit results to Testsigma..."
81-
curl --location 'https://test-management.testsigma.com/api/v1/projects/<Project_ID>/junit-import/test-run/<Run_ID>' \
81+
curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \
8282
--header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \
8383
--form "junit_xml=@target/surefire-reports/TEST-MyTests.xml"
8484
```
8585

8686
[[info | **NOTE**:]]
8787
| - Replace `<Project_ID>` in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.
88-
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: `https://test-management.testsigma.com/ui/test_runs/<Run_ID>/`
88+
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: https://test-management.testsigma.com/ui/test_runs/{Run_ID}/
8989
| - Ensure the path to the JUnit report points to the actual XML file generated by Maven.
9090

9191

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: 'GitLab Integration with Test Management by Testsigma'
3+
page_title: 'GitLab Integration with Test Management by Testsigma'
4+
metadesc: 'Integrate GitLab with Test Management by Testsigma to automate test executions & generate test reports through CI/CD pipelines | GitLab Integration with TMS by Testsigma'
5+
noindex: false
6+
order: 14.6
7+
page_id: 'Gitlab-ci-integration-with-test-management-by-testsigma'
8+
warning: false
9+
contextual_links:
10+
- type: section
11+
name: 'Contents'
12+
- type: link
13+
name: 'Prerequisites'
14+
url: '#prerequisites'
15+
- type: link
16+
name: 'Set Testsigma Secrets in GitLab'
17+
url: '#set-testsigma-secrets-in-gitlab'
18+
- type: link
19+
name: 'Configure the GitLab Pipeline'
20+
url: '#configure-the-gitlab-pipeline'
21+
- type: link
22+
name: 'Triggering the Pipeline'
23+
url: '#triggering-the-pipeline'
24+
---
25+
26+
<br>
27+
28+
**Integrate GitLab with Test Management by Testsigma and automate your test runs and generate test reports.**
29+
30+
---
31+
32+
Integrate GitLab with Test Management by Testsigma to automate test executions and generate test reports through CI/CD pipelines. This article discusses integrating GitLab with Test Management by Testsigma.
33+
34+
---
35+
36+
> ## **Prerequisites**
37+
> Before you begin, ensure the following:
38+
> - You have a **GitLab** account and a connected project repository.
39+
> - A project and at least one test run exist in Test Management by Testsigma.
40+
> - You have an API token from Test Management by Testsigma.
41+
> - Your test results are generated in JUnit XML format (for example, reports/junit.xml)
42+
43+
---
44+
45+
## **Set Testsigma Secrets in GitLab**
46+
47+
To allow GitLab to communicate securely with Testsigma:
48+
49+
1. Go to your project in GitLab
50+
51+
2. Navigate to **Settings > CI/CD > Variables** and click **Expand**.
52+
53+
3. Add the following environment variables:
54+
- **TESTSIGMA\_API\_TOKEN**
55+
- **TESTSIGMA\_PROJECT\_ID**
56+
- **TESTSIGMA\_RUN\_ID**
57+
58+
4. Click **Save** changes.
59+
60+
---
61+
62+
## **Configure the GitLab Pipeline**
63+
64+
In your project repository, create or update the **.gitlab-ci.yml** file in the root directory with the following configuration:
65+
66+
```yml
67+
stages:
68+
- upload
69+
70+
upload_testsigma:
71+
stage: upload
72+
image: curlimages/curl:8.10.1
73+
only:
74+
- main
75+
script:
76+
- 'set -eu'
77+
- 'echo "Looking for reports/junit.xml ..."'
78+
- 'test -f reports/junit.xml || { echo "File not found: reports/junit.xml"; exit 1; }'
79+
- 'echo "Uploading JUnit XML to Testsigma..."'
80+
- 'curl --fail --show-error --location \
81+
--header "Authorization: Bearer ${TESTSIGMA_API_TOKEN}" \
82+
--form "junit_xml=@reports/junit.xml" \
83+
"https://test-management.testsigma.com/api/v1/projects/${TESTSIGMA_PROJECT_ID}/junit-import/test-run/${TESTSIGMA_RUN_ID}"'
84+
- 'echo "Upload complete."'
85+
```
86+
87+
This configuration performs the following actions:
88+
- Runs when you push to the main branch.
89+
- Verifies that the JUnit XML file exists.
90+
- Upload the test results to your specified Testsigma project and test run.
91+
92+
[[info | **NOTE**:]]
93+
| - Replace **TESTSIGMA\_PROJECT\_ID** in the curl command with your Project ID. You can find it in your project URL: https://test-management.testsigma.com/ui/projects/{Project_ID}/
94+
| - Replace **TESTSIGMA\_RUN\_ID** in the curl command with your **Test Run ID**, available in the **Test Run URL**: https://test-management.testsigma.com/ui/test_runs/{Run_ID}/
95+
| - Replace **TESTSIGMA\_API\_TOKEN** with your Testsigma API token stored in GitLab CI/CD variables.
96+
| - Ensure the JUnit report path (reports/junit.xml) matches your actual test report file location.
97+
98+
---
99+
100+
## **Triggering the Pipeline**
101+
102+
1. Commit and push your changes to the repository connected to GitLab.
103+
104+
2. GitLab will run the workflow.
105+
106+
3. After completion, the corresponding test run in Test Management by Testsigma will be automatically updated with the test execution results.
107+
108+
---

src/pages/docs/test-management/ci-cd-integrations/jenkins.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Jenkins Integration with Test Management'
2+
title: 'Jenkins Integration with Test Management by Testsigma'
33
page_title: 'Jenkins Integration with Test Management by Testsigma'
44
metadesc: 'Integrate Jenkins with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | Jenkins Integration with TMS by Testsigma'
55
noindex: false
@@ -93,7 +93,7 @@ Integrate Jenkins with Test Management by Testsigma to automate test executions
9393
steps {
9494
// Ensure the test result file exists at the specified path
9595
sh '''
96-
curl --location 'https://test-management.testsigma.com/api/v1/projects/<Project_ID>/junit-import/test-run/<Run_ID>' \
96+
curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \
9797
--header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \
9898
--form "junit_xml=@target/test-results/test-report.xml"
9999
'''
@@ -106,7 +106,7 @@ Integrate Jenkins with Test Management by Testsigma to automate test executions
106106
107107
[[info | **NOTE**:]]
108108
| - Replace `<Project_ID>` in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.
109-
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: `https://test-management.testsigma.com/ui/test_runs/<Run_ID>/`
109+
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: https://test-management.testsigma.com/ui/test_runs/{Run_ID}/
110110
111111
7. Click **Apply**, and then click **Save**.
112112

src/pages/docs/test-management/ci-cd-integrations/travis-ci.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Travis CI Integration with Test Management'
2+
title: 'Travis CI Integration with Test Management by Testsigma'
33
page_title: 'Travis CI Integration with Test Management by Testsigma'
44
metadesc: 'Integrate Travis CI with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | Travis CI Integration with TMS by Testsigma'
55
noindex: false
@@ -83,14 +83,14 @@ Integrate Travis CI with Test Management by Testsigma to automate test execution
8383
after_success:
8484
# 📤 Upload JUnit report to Testsigma
8585
- echo "Uploading JUnit results to Testsigma..."
86-
- curl --location 'https://test-management.testsigma.com/api/v1/projects/<Project_ID>/junit-import/test-run/<Run_ID>' \
86+
- curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \
8787
--header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \
8888
--form "junit_xml=@target/surefire-reports/TEST-MyTests.xml"
8989
```
9090

9191
[[info | **NOTE**:]]
9292
| - Replace `<Project_ID>` in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.
93-
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: `https://test-management.testsigma.com/ui/test_runs/<Run_ID>/`
93+
| - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: https://test-management.testsigma.com/ui/test_runs/{Run_ID}/
9494
| - Ensure the path to the JUnit report points to the actual XML file generated by Maven.
9595

9696

0 commit comments

Comments
 (0)