Authentication parameters at Allure TestOps and at Circle CI
We need Circle CI to be able to send test results to Allure TestOps server, and we need Allure Server to be able to start build jobs on Circle CI side.
You need to have an existing project in Allure TestOps.
There are 2 authentications we need to configure:
- Authenticate Circle CI, so it will be able to send test results from build jobs to Allure TestOps server.
- Authenticate Allure TestOps to start build jobs on Circle CI side.
At the moment, for both cases it is advised to have dedicated account on both sides.
Create a user on Allure side and call it something like circle-ci-agent. This user should have only
ROLE_USERauthority assigned in settings (Administration > Users). We strongly advise to not use
ROLE_ADMINfor the integrations as it could lead to undesired consequences in case of human errors.
Create a user on Circle CI side and call it something like allure-server.
You still can use any other user’s account for the integrations.
Authenticate Circle CI in Allure TestOps
To upload the test results from Circle CI to Allure TestOps we are going to use allurectl tool.
Allurectl requires 3 mandatory environment variables to be added and set. Next steps describe the actions need to be performed to set these 3 variables.
Generate secret token on Allure TestOps side
Here you will find the description on how to generate Allure TestOps secret token.
Follow the steps and get back to this page.
Add your Allure server instance information to Circle CI’ configuration.
Navigate to the settings of a project
Navigate to Environment Variables section
Create 3 variables as shown below
ALLURE_ENDPOINT- Allure TestOps URL (for example: http://allure.company.com).
ALLURE_TOKEN- Allure TestOps token you generated recently.
ALLURE_PROJECT_ID- Allure TestOps project ID to which you are going to upload the results results.
Before you jump to build jobs, let’s configure the authentication for Allure TestOps server to start build jobs!
Authenticate Allure TestOps to start build jobs on Circle CI side
This section describes the integrations available/configurable in Allure TestOps before Release 4.0.0
CircleCI integration setup for releases 4+ is described in Allure TestOps’ UI
The aim of this step is to generate secret token on Circle CI side and provide it to Allure TestOps, so Allure TetsOps will be able to start build jobs on CI side.
Generate API token for the Circle CI’ user that will be used for Allure TestOps
- Log in to Circle CI.
- Proceed to user’s settings (lower left corner with your avatar).
- In the section Personal API Tokens click Generate New Token.
- Create personal access token give it a distinguishable name and copy its value to the clipboard.
Create credentials for Circle CI in Administration section in Allure TestOps
In the main interface of Allure TestOps go to the User menu and select Administration. Go to the Credentials section.
Click the Create button. Specify a name for Circle CI credentials and select type Token, then provide Circle CI’s token in the Token text-box.
Create a new build server for Circle CI
- In the user menu select Administration
- Go to the Build Server section.
- Click Create button to create a new build server for Circle CI system.
- Specify the Name and Endpoint parameters (https://circleci.com).
- Select circleci type from the drop-down list.
- Add credentials created at the previous step - select from the drop-down list.
- Click Test connection button to check if the connection is established with Circle CI build server (5).
- Submit the changes if everything is working properly (6).
These two steps you’ve performed will allow you sending test results from Circle CI to Allure TestOps and will allow Allure TestOps to start build jobs on Circle CI build server.