Reflect Docs

Connecting to CI/CD

Automatically execute Reflect tests from within your Continuous Integration/Continuous Deployment pipeline.

Via the Reflect API, you can automatically execute tests associated with a given tag (e.g. a ‘smoke-test’ tag). Below we’ve outlined how to trigger a Reflect API request from within several popular CI/CD tools.

Bitbucket Pipeline

To kick off Reflect tests as part of your pipeline, you’ll need to add an additional step in your existing bitbucket-pipelines.yml

    - step:
      name: Regression Tests
      - curl -X POST --data "{}" -H "x-api-key: <API-KEY>"<TAG-SLUG>/executions

We recommend that you set up your Reflect API Key as a secure environment variable rather than including it directly in your bitbucket-pipelines.yml file.

For more information on setting up Bitbucket Pipeline, please consult Bitbucket’s online documentation.


To enable automated test execution, add an additional step in your CircleCI config.yml:

    - run:
      name: Regression Tests
      command: |
        curl -X POST --data "{}" -H "x-api-key: <API-KEY>"<TAG-SLUG>/executions

Your Reflect API key should be set outside of version control as an Environment Variable rather than hard-coded in your config.yml.

More information on calling REST APIs as part of a CircleCI build is available on the CircleCI blog.

GitHub Actions

Integrating with Github Actions

A request to the Reflect API can be triggered via the httpie.action Action.

workflow "Regression Tests" {
  on = "push"
  resolves = ["Call Reflect API"]

action "Call Reflect API" {
  uses = "swinton/httpie.action@<COMMIT-SHA>"
  args = ["POST", "<TAG-SLUG>/executions", "x-api-key:<API-KEY>", "parallelism:=1"]
Integrating via Webhooks

Alternatively you can trigger Reflect tests by configuring a Webhook. For example, you can set up your Webhook to execute when a deployment status event with the value success is returned, meaning that a deployment of a git commit hash to a given environment has completed successfully.

For more information on configurating Webhooks, consult Github’s online documentation.

Gitlab CI/CD

A Reflect API request can be issued from your Gitlab CI/CD pipeline by modifying your existing .gitlab-ci.yml file:

  stage: deploy
  - curl -X POST --data "{}" -H "x-api-key: <API-KEY>"<TAG-SLUG>/executions

The Reflect API key should be set as a predefined environment variable rather than hard-coded into the .gitlab-ci.yml.

For more information, check out Gitlab’s online documentation.

Jenkins Pipeline

A request to the Reflect API can be trigger via Jenkins Pipeline’s http_request plugin.

pipeline {
  stages {
    stage('Regression Test') {
      steps {
        script {
          httpRequest('<TAG-SLUG>/executions', customHeaders: [{name: 'x-api-key', value: 'API-KEY'}], requestBody: '{}')

For more information, please review the Jenkins Pipeline online documentation.

Copyright © 2020 Reflect Software LLC. All Rights Reserved.