Authentication parameters on Allure TestOps and Jenkins
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.
There are 2 authentications we need to configure:
- Authenticate Jenkins 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 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_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 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.
Open Jenkins’ configuration page: Manage Jenkins > Configure System
Navigate to Allure Servers section of the configuration page
- Click Add Allure Server button and setup server location
- 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.
- Choose created credentials from the drop-down list Credentials and press Test Connection button
- 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
Go to the user’s configuration
Add new API-token for the user
Save new token somewhere safe as you cannot retrieve it from Jenkins
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.
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.
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.