Authentication parameters on Allure TestOps and Gitlab
We need Gitlab to be able to send test results to Allure TestOps server, and we need Allure Server to be able to start build jobs on Gitlab side.
There are 2 authentications we need to configure:
- Authenticate Gitlab 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 Gitlab 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 gitlab-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 Gitlab side and call it something like allure-server.
Authenticate Gitlab in Allure TestOps
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 Gitlab’ configuration.
Navigate to CI / CD project settings
Navigate to Variables section
Create 3 variables as shown below
ALLURE_ENDPOINT- Allure TestOps URL (for example: http://allure.company.com).
ALLURE_TOKEN- Allure TestOps token
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 Gitlab side
The aim of this step is to generate secret token on Gitlab side and provide it to Allure TestOps, so it will be able to start build jobs.
Generate API token for the Gitlab’ user that will be used for Allure TestOps
- Log in to GitLab.
- In the upper-right corner click your avatar and select Settings, then select Access Tokens in the User Settings menu.
- Create personal access token with the name allure and copy it to the clipboard.
Create credentials for Gitlab 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 the Name for GitLab credentials and select type Token, then specify GitLab token in the Token box.
Create the build server for Gitlab system
- In the user menu select Administration
- Go to the Build Server section.
- Click the Create button to create the build server for GitLab system.
- Specify the Name (1) and Endpoint parameters (2).
- Select gitlab type from the drop-down list (3).
- Add credentials created at the previous step from the drop-down list (4).
- Click Test connection button to check if the connection is established with Gitlab 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 Gitlab to Allure and will allow Allure TestOps to start build jobs on Gitlab build server.