---
title: 'CircleCI Integration with Test Management by Testsigma'
metadesc: 'Integrate CircleCI with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | CircleCI Integration with TMS by Testsigma'
canonical: 'https://testsigma.com/docs/test-management/ci-cd-integrations/circleci/'
page_id: 'circle-ci-integration-with-test-management-by-testsigma'
---

# CircleCI Integration with Test Management by Testsigma






**Integrate CircleCI with Test Management by Testsigma and automate your test runs and generate test reports.**

---

Integrate CircleCI with Test Management by Testsigma to automate test executions and generate test reports through CI/CD pipelines. This article discusses integrating CircleCI with Test Management by Testsigma.

---

> ## **Prerequisites**
> 
> Before you begin, ensure:
> - You have a **Project** in Test Management by Testsigma and **Test Runs** are available.
> - You have an API token from Test Management by Testsigma.
> - You have a **CircleCI** account.


---

## **Set Environment Variables in CircleCI**

1. Navigate to your project in **CircleCI**.

2. Go to **Project Settings > Environment Variables**.

3. Add a new variable:
   - **Name**: `TESTSIGMA_API_TOKEN`
   - **Value**: API token from Testsigma

> **NOTE**:
> Ensure this value is kept secret and not displayed in logs.

---

## **Configure the CircleCI Pipeline**

1. Navigate to your **CircleCI** repository. 

2. Open or create the `.circleci/config.yml` file in the root directory.

3. Add the following code into the `.circleci/config.yml` file:

    ```yaml
    version: 2.1

    jobs:
    build:
        docker:
        - image: cimg/openjdk:8.0
        environment:
        TESTSIGMA_API_TOKEN: << pipeline.parameters.testsigma_api_token >>

        steps:
        # ✅ Step 1: Check out the code
        - checkout

        # 🔨 Step 2: Build and test with Maven
        - run:
            name: 🔨 Build and Test with Maven
            command: mvn clean package

        # 📤 Step 3: Upload JUnit results to Testsigma
        - run:
            name: 📤 Upload JUnit Results to Testsigma
            command: |
                echo "Uploading JUnit results to Testsigma..."
                curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \
                --header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \
                --form "junit_xml=@target/surefire-reports/TEST-MyTests.xml"

    workflows:
    version: 2
    test_and_upload:
        jobs:
        - build:
            parameters:
                testsigma_api_token:
                type: env_var_name
                default: TESTSIGMA_API_TOKEN
    ```


> **NOTE**:
> - Replace `<Project_ID>` in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.
> - 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}/
> - Ensure the path to the JUnit report points to the actual XML file generated by Maven.


---

## **Triggering the Pipeline**

1. Commit and push your changes to the repository connected to CircleCI.


2. **CircleCI** will run the workflow.


3. After completion, the corresponding test run in Test Management by Testsigma will be automatically updated with the test execution results.


---