![]() |
VOOZH | about |
Run Continuous Testing tests in your GitLab pipelines, block deployments, and trigger rollbacks to ensure your code is added in production when your essential business workflows are functioning as expected.
To integrate Continuous Testing tests with a GitLab pipeline, you can use the datadog-ci npm package.
To get started:
For more information, see CI/CD Integrations Configuration.
stages:- testsynthetic-tests:stage:testscript:- npm install -g @datadog/datadog-ci- datadog-ci synthetics run-tests --apiKey "$DATADOG_API_KEY" --appKey "$DATADOG_APP_KEY" --public-id xtf-w5p-z5n --public-id eif-van-tu7stages:- testsynthetic-tests:stage:testscript:- npm install -g @datadog/datadog-ci- datadog-ci synthetics run-tests --apiKey "$DATADOG_API_KEY" --appKey "$DATADOG_APP_KEY" -s 'tag:e2e-tests'If you have different test users or data specific to your CI/CD environment, you can override these variables with the -v command. For more information, see the Synthetics command in the datadog-ci NPM package.
stages:- testsynthetic-tests:stage:testscript:- npm install -g @datadog/datadog-ci- datadog-ci synthetics run-tests --apiKey "$DATADOG_API_KEY" --appKey "$DATADOG_APP_KEY" -s 'tag:e2e-tests' -v PASSWORD="$PASSWORD"Add a custom config.json file to your pipeline repository and access it in your pipeline configuration.
stages:- testsynthetic-tests:stage:testscript:- npm install -g @datadog/datadog-ci- datadog-ci synthetics run-tests --apiKey "$DATADOG_API_KEY" --appKey "$DATADOG_APP_KEY" --config synthetics_global.json -f synthetic_test.jsonThis example demonstrates the pipeline has identified the configuration file and is running the test:
A successful test output returns the following in GitLab:
Additional helpful documentation, links, and articles:
| |