Configuring authentication for Circle CI

Authentication parameters at Allure TestOps and at Circle CI

The task

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

Prerequisites

You need to have an existing project in Allure TestOps.

Two steps

There are 2 authentications we need to configure:

  1. Authenticate Circle 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 Circle CI 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 circle-ci-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 Circle CI side and call it something like allure-server.

You still can use any other user’s account for the integrations.

Authenticate Circle CI in Allure TestOps

To upload the test results from Circle CI 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 Circle CI’ configuration.

  1. Navigate to the settings of a project

    if you see this, create a ticket to support.qameta.io

  2. Navigate to Environment 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 you generated recently.
    3. ALLURE_PROJECT_ID - Allure TestOps project ID to which you are going to upload the results results.

if you see this, create a ticket to support.qameta.io

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 Circle CI side

This section describes the integrations available/configurable in Allure TestOps before Release 4.0.0

CircleCI integration setup for releases 4+ is described in Allure TestOps’ UI

The aim of this step is to generate secret token on Circle CI 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 Circle CI’ user that will be used for Allure TestOps

  1. Log in to Circle CI.
  2. Proceed to user’s settings (lower left corner with your avatar).
  3. In the section Personal API Tokens click Generate New Token.
  4. Create personal access token give it a distinguishable name and copy its value to the clipboard.

Create credentials for Circle CI 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 a name for Circle CI credentials and select type Token, then provide Circle CI’s token in the Token text-box.

Add new credentials

Create a new build server for Circle CI

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

Add Circle CI build server

  1. Click Test connection button to check if the connection is established with Circle CI 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 Circle CI to Allure TestOps and will allow Allure TestOps to start build jobs on Circle CI build server.

Back to Circle CI integrations