Authentication parameters at Allure TestOps and at GitHub
The task
We need GitHub to be able to send test results to Allure TestOps server, and we need Allure Server to be able to start build jobs on GitHub side.
Prerequisites
You need to have an existing project in Allure TestOps.
Two steps
There are 2 authentications we need to configure:
- Authenticate GitHub, so it will be able to send test results from build jobs to Allure TestOps server.
- Authenticate Allure TestOps to start build jobs on GitHub side.
We strongly advise not to use ROLE_ADMIN
for the integrations as it could lead to undesired consequences in case of human errors.
Authenticate GitHub in Allure TestOps
To upload the test results from GitHub 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 GitHub configuration.
-
Navigate to the Settings of your repository.
-
Navigate to Secrets section.
-
Create 3 variables in Repository secrets 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 of your tests.
4. These secrets will be used then in your workflows to define environment 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 GitHub side
The aim of this step is to generate secret token on GitHub 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 GitHub’ user that will be used for Allure TestOps
- Log in to GitHub, Proceed to user’s settings (upper right corner with your avatar).
- In the section Developer settings jump to Personal access tokens.
- Click Generate new token button and select the scopes for new token.
Create credentials for GitHub 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 GitHub credentials and select type Token, then provide GitHub’s token in the Token text-box.
Create a new build server for GitHub
- In the user menu select Administration
- Go to the Build Server section.
- Click Create button to create a new build server for GitHub system.
- Specify the Name and Endpoint parameters (https://api.github.com).
- Select github 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 GitHub build server.
- Submit the changes if everything is working properly.
That’s it!
Summary
These two steps you’ve performed will allow you sending test results from GitHub to Allure TestOps and will allow Allure TestOps to start build jobs on GitHub build server.