Skip to main content

Integrating with Gitlab

GitLab is a powerful platform for source code management and CI/CD pipelines, enabling teams to automate builds, tests, and deployments.

This guide details how to execute DevAssure tests in a GitLab pipeline using the DevAssure Command Line Interface (CLI).

Prerequisites

Create a GitLab Project

  • Log in to your GitLab account.
  • Create a new project by clicking on "New project" in the top navigation bar.
  • Enter the project name and description, choose visibility settings (public, private, or internal), and click "Create project."
Icon

Create a GitLab Pipeline Configuration File

  • Navigate to CI/CD and click on Jobs.
  • Click on "Create CI/CD configuration file" This will create a new file named .gitlab-ci.yml in the root of your project's repository.

Define Variables:

  • In your GitLab project's settings, go to "CI/CD" and then "Variables".
  • Define the following CLI parameters required for the job run as variables
  • Alternatively they can be included in the YAML file.
  • CLI Parameters

Configure the Pipeline Stages

Add the following YAML code to configuration file:

variables:
SOURCE_PATH: '.'
TARGET_PATH: '/temp/'
SUITE_PATH: './test-suite/P0.suite.tspp'
DEVASSURE_CLI_URL : 'https://devassures3bucket.s3.amazonaws.com/linux/cli/DevAssure.zip' #
DEVASSURE_TOKEN : 'eyJhbGciOiJIUzI1NiJ9.eyJjdXN0b21fdG9rZW4iOiJlZjQ3NDY0NjUwZWU1Y2MwZGI4MyIsInVzZXJfaWQiOjY2fQ.qiPCZvGKu5AovfJtQTE2p6PChVHj9YOJh_5c'
JOB_NAME: 'gitlab_tests'
RUN_PROFILE_PATH : './run-profile/Chrome.profile.tspp'

stages: # List of stages for jobs, and their order of execution
- execute_test


download_cli:
stage : execute_test
script:
- echo "Download and unzip DevAssure CLI ..."
- curl -L $DEVASSURE_CLI_URL -o DevAssure.zip
- unzip DevAssure.zip
- echo "Execute Tests ..."
- ./DA --auth-token ${DEVASSURE_TOKEN} --source ${SOURCE_PATH} --target ${TARGET_PATH} run --suite ${SUITE_PATH} --total-nodes 1 --node-id 0 --branch gl --job-name gitlab --run-profile ${RUN_PROFILE_PATH}

Icon
info

We suggest you get help from your Ops team in configuring the Build Pipeline if you are trying it for the first time.

Commit and Push Changes

After updating or creating the .gitlab-ci.yml file, commit the changes to your repository and push them to the desired branch.

Executing the Pipeline

  • Go to your GitLab project’s Pipelines page.

  • Trigger a new pipeline manually or via an automated push to the configured branch.

  • Monitor Pipeline Stage. The Pipeline status is displayed on top of the page

  • Check the logs for the pipeline stage to verify successful execution.

Viewing Test Results

  • Upon successful execution, the test results will be submitted to your DevAssure web app.
  • Log in to the DevAssure web application and navigate to the Reports section to review detailed test outcomes.