Configuring authentication

Authentication parameters on Allure TestOps and Jenkins

The task

We need Jenkins to be able to send test results to Allure TestOps server, and we need Allure Server to be able to start build jobs on Jenkins side.

Two steps

There are 2 authentications we need to configure:

  1. Authenticate Jenkins 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 Jenkins 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 jenkins-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 Jenkins side and call it something like allure-server.

Authenticate Jenkins in Allure TestOps

Generate secret token on Allure TestOps side

This authentication token will be used by Jenkins to authenticate in Allure TestOps server.

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 Jenkins’ configuration.

  1. Open Jenkins’ configuration page: Manage Jenkins > Configure System

  2. Navigate to Allure Servers section of the configuration page

Allure Server List

  1. Click Add Allure Server button and setup server location

Allure Server Add

  1. In Credentials section click Add button and create a credential with Kind parameter Kind = Secret text and paste the token you generated on the previous step.

Credentials Add

  1. Choose created credentials from the drop-down list Credentials and press Test Connection button

Allure Server Test

  1. Save Jenkins’ configuration

That’s it. Now, you can configure your build jobs to send test results to Allure TestOps server.

But 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 Jenkins side

The aim of this step is to generate secret token on Jenkins side and provide it to Allure TestOps, so it will be able to start build jobs.

Generate API token for the Jenkins’ user that will be used for Allure TestOps

  1. Go to the user’s configuration

    Jenkins account config

  2. Add new API-token for the user

    Jenkins add API token

  3. Save new token somewhere safe as you cannot retrieve it from Jenkins

    Jenkins copy API token

Create credentials for Jenkins in Administration section in Allure TestOps

IMPORTANT: Use basic type with user name on Jenkins with the API token generated on previous steps instead of a password.

Allure TestOps add credential

Create the build server for Jenkins system

  • In the Administration area of Allure TestOps jump to Build server section and create new build server for your Jenkins instance.

  • Use jenkins type and credentials you’ve created on the previous step - select from the drop-down list.

  • Test the connection by clicking the Test connection button and submit the data.

    Allure TestOps add jenkins build server

That’s it!

Summary

These two steps you made will allow you to send test results from Jenkins to Allure and will allow Allure TestOps to start build jobs on Jenkins build server.

Back to Jenkins integrations