Configuring authentication

Authentication parameters on Allure TestOps and Gitlab

The task

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.

Two steps

There are 2 authentications we need to configure:

  1. Authenticate Gitlab CI, so it will be able to send test results from build jobs to Allure TestOps server.
  2. 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_USER authority assigned in settings (Administration > Users). We strongly advise to not use ROLE_ADMIN for 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.

  1. Navigate to CI / CD project settings

    Gitlab menu

  2. Navigate to Variables section

  3. Create 3 variables as shown below

    1. ALLURE_ENDPOINT - Allure TestOps URL (for example: http://allure.company.com).
    2. ALLURE_TOKEN - Allure TestOps token
    3. ALLURE_PROJECT_ID - Allure TestOps project ID to which you are going to upload the results results.

Gitlab CI-CD Variables

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

  1. Log in to GitLab.
  2. In the upper-right corner click your avatar and select Settings, then select Access Tokens in the User Settings menu.
  3. Create personal access token with the name allure and copy it to the clipboard. Jenkins new token

Create credentials for Gitlab in Administration section in Allure TestOps

  1. In the main interface of Allure TestOps go to the User menu and select Administration. Go to the Credentials section.

  2. Click the Create button. Specify the Name for GitLab credentials and select type Token, then specify GitLab token in the Token box.

Add new credentials

Create the build server for Gitlab system

  1. In the user menu select Administration
  2. Go to the Build Server section.
  3. Click the Create button to create the build server for GitLab system.
  4. Specify the Name (1) and Endpoint parameters (2).
  5. Select gitlab type from the drop-down list (3).
  6. Add credentials created at the previous step from the drop-down list (4).

Add Gitlab build server

  1. Click Test connection button to check if the connection is established with Gitlab build server (5).
  2. Submit the changes if everything is working properly (6).

That’s it!

Summary

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.

Back to Gitlab integrations