CI/CD

Learn how to connect DogQ tests to your CI/CD pipeline.

Each Project in DogQ has its own API token and a Webhook Link associated with it. These two features are for triggering tests externally (token) and receiving back test results (webhook) upon their completion. Together they enable us to connect DogQ to a CI/CD pipeline to supplement the testing process.

Use cases can be different but the most common ones are regression tests that are automatically triggered upon merging new changes into the staging environment and/or tests that are run when a new build is deployed, replacing a major prod version.

Get your API token

In the Project Settings you can find a token that is unique to the Project and can be used to trigger it externally. For example, upon pushing changes to your staging environment.

You can copy and use this cURL command:

curl --location --request POST "https://dogq.io/projects/external_execute" --header "TOKEN: your_token"

Replace "your_token" in this cURL command with the actual token.

Using this token will trigger the execution of the whole Project, so if you want to only run certain tests, you will need to temporarily deactivate the rest. Project token can be changed. Clicking on the respective button next to the token will randomly generate a new one.

All such test executions will be available on the Test Runs page and have an External api call status in the "Created by" column.

The field you need to put your link into is in the Notifications tab of the Project Settings.

By providing a URL of an open endpoint, we enable DogQ to send POST requests there. Our IP address is 3.145.188.138 and the payload this webhook carries is an object with test results using which you can further automate your pipeline, e.g., if there are no failed test runs -> deploy to production.

Here's a rundown of the object key-value pairs:

  1. project_id : the ID of your project

  2. project_name : your project name

  3. status : "passed" (if all tests passed successfully) or "failed" (if at least one test failed)

  4. full_test_run_count : the overall number tests executed

  5. test_runs_passed_count : the number of tests that passed successfully

  6. test_runs_failed_count : the number of tests that have failed during the execution

  7. test_runs_url : a URL to Test Runs page with the results

The Webhook Link feature, like other notifications, only works for scheduled and externally executed runs. Once you've provided the link DogQ will attempt to send a webhook every time the Project is executed via schedule or externally. If you would like DogQ to stop, remove the link from the settings.

Last updated