Skip to content
You're viewing the v2 docs. Looking for v1?Go to v1 docs
Docs
Arcus
Popular questions
↑↓ to navigate↵ to selectesc to close
Book a demo

GitLab CI/CD

Integrating GitLab with Arcus by Testsigma uploads your JUnit test results to a test run at the end of a pipeline, so test case statuses update automatically.

Prerequisites

  • A GitLab account with a connected project repository.
  • A project in Arcus by Testsigma with at least one test run.
  • An Arcus by Testsigma API token.
  • Test results generated in JUnit XML format, for example at reports/junit.xml.

The GitLab pipeline reads the project and run IDs from variables rather than from the script itself.

  1. Open your project in GitLab.

  2. Go to Settings > CI/CD > Variables and click Expand.

  3. Add these 3 variables:

    • TESTSIGMA_API_TOKEN: your Arcus by Testsigma API token.
    • TESTSIGMA_PROJECT_ID: your project ID, which appears in your project URL: https://test-management.testsigma.com/ui/projects/<Project_ID>/.
    • TESTSIGMA_RUN_ID: the run ID, which appears in the URL when you view a test run: https://test-management.testsigma.com/ui/test_runs/<Run_ID>/.
  4. Click Save changes.

In your repository, create or update .gitlab-ci.yml in the root directory:

stages:
- upload
upload_testsigma:
stage: upload
image: curlimages/curl:8.10.1
only:
- main
script:
- 'set -eu'
- 'echo "Looking for reports/junit.xml ..."'
- 'test -f reports/junit.xml || { echo "File not found: reports/junit.xml"; exit 1; }'
- 'echo "Uploading JUnit XML to Testsigma..."'
- 'curl --fail --show-error --location --header "Authorization: Bearer ${TESTSIGMA_API_TOKEN}" --form "junit_xml=@reports/junit.xml" "https://arcus.testsigma.com/api/v1/projects/${TESTSIGMA_PROJECT_ID}/junit-import/test-run/${TESTSIGMA_RUN_ID}"'
- 'echo "Upload complete."'

The pipeline does 3 things:

  • Runs when you push to main.
  • Checks that the JUnit XML file exists, and fails the job if it doesn’t.
  • Uploads the results to the project and test run named in your variables.

Change reports/junit.xml everywhere it appears if your build writes its report somewhere else.

Commit and push to the repository connected to GitLab. GitLab runs the pipeline, and when it finishes the test run in Arcus by Testsigma updates with the execution results.

Was this page helpful?