Azure DevOps CI
Azure DevOps CI integration connects Azure Pipelines with Allure TestOps: uploads test results, lets TestOps trigger pipeline runs, and keeps jobs synchronized across both systems.
If you need work-item linking rather than CI execution, see Azure DevOps Work Items.
Before you begin
- The URL of your Allure TestOps instance.
- The ID of the TestOps project that will receive the results.
- Access to edit the target
azure-pipelines.yml. - An Azure DevOps personal access token for the project owner who will connect the project-level integration.
1. Send results from Azure Pipelines to TestOps
Create the TestOps token
- In Allure TestOps, click your avatar and open API Tokens.
- Click + Token.
- Enter a recognizable name, such as
Azure DevOps upload. - Click Create and copy the generated token.
Store the token in Azure DevOps
In Azure DevOps, open the target pipeline and click Edit.
Click Variables.
Click + and fill in the fields for the first variable:
- Name —
ALLURE_TOKEN - Value — the API token copied from TestOps
- Keep this value secret — checked
- Let users override this value when running this pipeline — unchecked
Click OK.
- Name —
Click + again and fill in the fields for the second variable:
- Name —
ALLURE_JOB_RUN_ID - Value — leave blank
- Keep this value secret — unchecked
- Let users override this value when running this pipeline — checked
Click OK.
- Name —
Click Save.
ALLURE_JOB_RUN_ID is reserved for the TestOps-to-Azure trigger path and must remain available even if the first upload comes from Azure DevOps itself.
Update azure-pipelines.yml
Download allurectl and wrap the test command with watch:
steps:
- bash: curl -fsSL https://github.com/allure-framework/allurectl/releases/latest/download/allurectl_linux_amd64 -o allurectl && chmod +x allurectl
displayName: Download allurectl
- script: ./allurectl watch -- ./gradlew clean test
displayName: Run tests
env:
ALLURE_ENDPOINT: https://testops.example.com
ALLURE_PROJECT_ID: 1
ALLURE_RESULTS: build/allure-results
ALLURE_TOKEN: $(ALLURE_TOKEN)
ALLURE_ENDPOINT— TestOps base URL.ALLURE_PROJECT_ID— numeric project ID in TestOps.ALLURE_RESULTS— directory that contains the generated result files. Separate multiple directories with commas or use a wildcard pattern.ALLURE_TOKEN— the secret variable created in Azure DevOps.
Verify the upload
After the next pipeline run:
- Open the Azure DevOps job log and confirm it prints a link to the TestOps launch.
- Open that launch in TestOps and confirm test results are present.
- Open one result and confirm it links back to the Azure pipeline run.
2. Let TestOps trigger Azure pipelines
Add the global integration
An instance administrator should:
- Open Administration → Integrations.
- Click + Add integration.
- Select Azure DevOps Server.
- Enter a stable name for the integration and the Azure DevOps organization URL.
- Click Add integration.
Create the Azure DevOps token
- In Azure DevOps, click the User settings icon and select Personal access tokens.
- Click New Token.
- Fill in the fields:
- Name — a recognizable name, such as
Token for Allure TestOps. - Organization — the Azure DevOps organization that contains the project.
- Expiration — how long the token should stay valid.
- Scopes — select Custom defined, then click Show all scopes at the bottom.
- Name — a recognizable name, such as
- Select the following scopes:
- Build → Read & execute
- Work Items → Read, write, & manage
- Variable Groups → Read
- Click Create and copy the generated token.
Add project credentials
- In TestOps, open the target project and go to Settings → Integrations.
- Find the Azure DevOps integration and click Add integration.
- Enter the Azure DevOps sign-in email and the generated token.
- Click Test connection. A "Connection established" message confirms the credentials are correct.
- Click Add integration.
Configure the job in TestOps
After the first upload, TestOps creates the Azure-backed job automatically. Review it before relying on bidirectional execution:
- Open Jobs in the project.
- Click
⋯next to the job name and select Configure. - Fill in the fields:
- Name — a stable display name.
- Build server — the global Azure DevOps integration added by the administrator.
- Job can be used to run tests — enable to allow triggering from TestOps.
- Click Submit.
3. Pass parameters and branch values
Environment parameters let TestOps control values such as branch, browser, or target environment and make them visible on launches triggered outside TestOps.
Add global environment names
An instance administrator should:
- Open Administration → Environment.
- For each parameter, click + Create, enter the name, and click Submit.
Map parameters in the project
- In the project, open Settings → Environment.
- For each parameter, click + Create (or the edit icon if it already exists):
- Mapping key — the name of the Azure DevOps variable.
- Environment variable — the global parameter name created above.
- Click Submit.
Add parameters to the job
- Open Jobs, click
⋯next to the job, and select Configure. - In the Parameters section, click Add for each parameter:
- Name — the Azure DevOps variable name (matches the mapping key).
- Value — the default value.
- Environment Variable — the global parameter name.
- Click Submit.
Add the variables to the Azure pipeline
- In Azure DevOps, open the pipeline and click Edit → Variables.
- For each parameter, click + and fill in:
- Name — the variable name (same as the mapping key).
- Value — the default value.
- Keep this value secret — unchecked.
- Let users override this value when running this pipeline — checked.
- Click Save.
If the project has multiple branches, add a Branch environment variable and map it to the Azure variable that controls branch selection.