- 重要な情報
- アプリ内
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Trigger Synthetic tests from your GitHub workflows with the Datadog CI Synthetics command.
To get started:
DataDog/synthetics-ci-github-action
.Your workflow can be simple or complex.
name: Run Synthetics tests using the test public IDs
jobs:
e2e_testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Datadog Synthetics tests
uses: DataDog/synthetics-ci-github-action@v0.10.0
with:
api_key: ${{secrets.DD_API_KEY}}
app_key: ${{secrets.DD_APP_KEY}}
public_ids: 'abc-d3f-ghi, jkl-mn0-pqr'
synthetics.json
filename: Run Synthetics tests using an existing synthetics.json file
jobs:
e2e_testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Datadog Synthetics tests
uses: DataDog/synthetics-ci-github-action@v0.10.0
with:
api_key: ${{secrets.DD_API_KEY}}
app_key: ${{secrets.DD_APP_KEY}}
Note: By default, this workflow runs all the tests listed in {,!(node_modules)/**/}*.synthetics.json
files (every file ending with .synthetics.json
except for those in the node_modules
folder). You can also trigger a list of Synthetics tests by specifying a public_id
or using a search query.
test_search_query
name: Run Synthetics tests by test tag
jobs:
e2e_testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Datadog Synthetics tests
uses: DataDog/synthetics-ci-github-action@v0.10.0
with:
api_key: ${{secrets.DD_API_KEY}}
app_key: ${{secrets.DD_APP_KEY}}
test_search_query: 'tag:e2e-tests'
name: Run Synthetics tests using search query
jobs:
e2e_testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Datadog Synthetics tests
uses: DataDog/synthetics-ci-github-action@v0.10.0
with:
api_key: ${{secrets.DD_API_KEY}}
app_key: ${{secrets.DD_APP_KEY}}
test_search_query: 'tag:staging'
variables: 'START_URL=https://staging.website.com,PASSWORD=stagingpassword'
config_path
name: Run Synthetics tests with custom config
jobs:
e2e_testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Datadog Synthetics tests
uses: DataDog/synthetics-ci-github-action@v0.10.0
with:
api_key: ${{secrets.DD_API_KEY}}
app_key: ${{secrets.DD_APP_KEY}}
config_path: './synthetics-config.json'
Name | Type | Requirement | Description |
---|---|---|---|
api_key | string | required | Your Datadog API key. This key is created by your Datadog organization and should be stored as a secret. Default: none. |
app_key | string | required | Your Datadog Application key. This key is created by your Datadog organization and should be stored as a secret. Default: none. |
public_ids | string | optional | Comma-separated list of public IDs for Synthetic tests you want to trigger. If no value is provided, the action looks for files named with synthetics.json . Default: none. |
test_search_query | string | optional | Trigger tests corresponding to a search query. Default: none. |
subdomain | string | optional | The name of the custom subdomain set to access your Datadog application. If the URL used to access Datadog is myorg.datadoghq.com , the subdomain value needs to be set to myorg . Default: app . |
files | string | optional | Glob pattern to detect Synthetic tests config files. Default: {,!(node_modules)/**/}*.synthetics.json . |
datadog_site | string | optional | The Datadog site. For users in the EU, set to datadoghq.eu . For example: datadoghq.com or datadoghq.eu . Default: datadoghq.com . |
config_path | string | optional | The global JSON configuration is used when launching tests. See the example configuration for more details. Default: datadog-ci.json . |
variables | string | optional | Comma-separated list of global variables to use for Synthetic tests. For example: START_URL=https://example.org,MY_VARIABLE=My title . Default: [] . |
junit_report | string | optional | The filename for a JUnit report if you want to generate one. Default: none. |
tunnel | boolean | optional | Use the secure tunnel to execute your test batch. Default: false . |
yarn test
# Build project
yarn build
# Compile project and its dependencies for release
yarn package
To release a new version of synthetics-ci-github-action
:
Create a new branch for the version upgrade.
Update the package version using yarn version [--patch|--minor|--major]
depending on the nature of your changes. See Semantic Versioning to determine what you need to increment. Once the yarn version
command is done, a new commit vX.Y.Z
along with a new tag should be added to the Git tree.
Update the README.md
example versions, and build and package the project with yarn build && yarn package
.
Make sure to commit these changes within the same commit that holds the vX.Y.Z
tag. You can use git commit --amend
or git rebase -i HEAD~2
to merge the changes into the same commit.
Push the branch along with the release tag (git push --tags
) to the upstream (GitHub).
Create a pull request with the changes introduced in the description. This pull request requires at least one approval.
Merge the pull request.
Create a GitHub Release from the Tags page with a description of your changes.
⚠️ Ensure the release version follows the expected format vX.Y.Z
.
Once the release is created, the new version of the Github Action is available as a workflow.
Additional helpful documentation, links, and articles: