- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
GitLab パイプラインで Continuous Testing テストを実行し、デプロイをブロックし、ロールバックをトリガーして、重要なビジネスワークフローが期待通りに機能するときに、コードが本番環境に追加されていることを確認します。
Continuous Testing テストを GitLab パイプラインにインテグレーションするには、datadog-ci npm パッケージを使用します。
始めるには
詳しくは、CI/CD インテグレーション構成をご覧ください。
stages:
- test
synthetic-tests:
stage: test
script:
- 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-tu7
stages:
- test
synthetic-tests:
stage: test
script:
- npm install -g @datadog/datadog-ci
- datadog-ci synthetics run-tests --apiKey "$DATADOG_API_KEY" --appKey "$DATADOG_APP_KEY" -s 'tag:e2e-tests'
もし、CI/CD 環境に固有のテストユーザーやデータがある場合は、-v
コマンドでこれらの変数をオーバーライドすることができます。詳しくは、NPM パッケージ datadog-ci
の Synthetics コマンドを参照してください。
stages:
- test
synthetic-tests:
stage: test
script:
- 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"
カスタム config.json
ファイルをパイプラインリポジトリに追加し、パイプラインの構成でアクセスします。
stages:
- test
synthetic-tests:
stage: test
script:
- 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.json
この例では、パイプラインがコンフィギュレーションファイルを識別し、テストを実行していることを示しています。
テスト出力に成功すると、GitLab で次のように返されます。
お役に立つドキュメント、リンクや記事: