Skip to content

Commit

Permalink
SME Review #1
Browse files Browse the repository at this point in the history
  • Loading branch information
alai97 committed Dec 2, 2021
1 parent b8b5c6a commit 1571ad0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
19 changes: 10 additions & 9 deletions content/en/synthetics/cicd_integrations/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,27 @@ The test triggering endpoint supports up to 50 tests in one request.
}
```

The `TEST_TO_TRIGGER` objects compose of the required `public_id` for the test you want to trigger and the optional configuration overrides. For descriptions of each field, see [Configure tests](#configure-tests).
The `TEST_TO_TRIGGER` objects compose of the required `public_id` for the test you want to trigger and the optional configuration overrides. For descriptions of each field, see [Configure tests][3].

A test's public identifier is either the identifier of the test found in the URL of a test's details page (for example: the identifier for `https://app.datadoghq.com/synthetics/details/abc-def-ghi` is `abc-def-ghi`) or the full URL of a test's details page (for example: `https://app.datadoghq.com/synthetics/details/abc-def-ghi`).

For more information, see the [Synthetics API endpoint documentation][1].

### Get details of batch

The get batch details endpoint [@Beth to add description here]...
The get batch details endpoint retrieves results for the group of tests triggered in your CI/CD pipeline, otherwise known as a batch. You must provide the `batch_id` for the relevant CI execution.

* **Endpoint**: `https://api.{{< region-param key="dd_site" >}}/api/v1/synthetics/tests/poll_results`
* **Endpoint**: `https://api.{{< region-param key="dd_site" >}}/api/v1/synthetics/ci/batch/{batch_id}`
* **Method**: `GET`
* **Parameters**: A JSON array containing the list of result identifiers to obtain results from.
* **Parameters**: The `batch_id` for the batch of test results you want to inspect.

For more information, see the [Synthetics API endpoint documentation][2].

## Use the CLI

The [`@datadog/datadog-ci` package][3] allows you to run Synthetics tests directly within your CI/CD pipeline.
The [`@datadog/datadog-ci` package][4] allows you to run Synthetics tests directly within your CI/CD pipeline.

To use the [`@datadog/datadog-ci` NPM package][4], see [Configuration][5].
To use the [`@datadog/datadog-ci` NPM package][5], see [Configuration][6].

You can also trigger tests by searching with tags. For example: `"ci": "datadog-ci synthetics run-tests --config fileconfig.json -s 'tag:staging'"`.

Expand All @@ -98,6 +98,7 @@ You can also trigger tests by searching with tags. For example: `"ci": "datadog-

[1]: /api/latest/synthetics/#trigger-tests-from-cicd-pipelines
[2]: /api/latest/synthetics/#get-details-of-batch
[3]: https://github.com/DataDog/datadog-ci
[4]: https://www.npmjs.com/package/@datadog/datadog-ci
[5]: /synthetics/cicd_integrations/configuration
[3]: /synthetics/cicd_integrations/configuration#configure-tests
[4]: https://github.com/DataDog/datadog-ci
[5]: https://www.npmjs.com/package/@datadog/datadog-ci
[6]: /synthetics/cicd_integrations/configuration
19 changes: 13 additions & 6 deletions content/en/synthetics/cicd_integrations/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ In the global configuration file, you can configure the following options:
`subdomain`
: 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 then needs to be set to `myorg`.

`tunnel`
: Use the [secure tunnel][3] to execute your test batch.

`testSearchQuery`
: Passes a query to select which Synthetic tests to run. If you are running tests in the CLI, use the `-s` flag.

For example:

{{< code-block lang="json" filename="Global Configuration File" disable_copy="false" collapsible="true" >}}
Expand Down Expand Up @@ -122,7 +128,8 @@ For example:
"port": 3128,
"protocol": "http"
},
"subdomain": "subdomainname"
"subdomain": "subdomainname",
"tunnel": true
}
{{< /code-block >}}

Expand All @@ -149,7 +156,7 @@ For example:

#### Additional configuration

The default configurations used for the tests are the original tests' configurations, which are visible in the UI or by [getting your tests' configurations from the API][3].
The default configurations used for the tests are the original tests' configurations, which are visible in the UI or by [getting your tests' configurations from the API][4].
However, in the context of your CI deployment, you may decide to override some or all of your test parameters with the overrides below. To define overrides for all of your tests, set the same parameters at the [global configuration file](#setup-a-client) level.
Expand Down Expand Up @@ -303,7 +310,7 @@ Whether you use Synthetic tests to control your CI/CD deployments in production

To trigger an existing Synthetics test on a staging endpoint instead of in production, set the `$SUBDOMAIN` environment variable to `staging-example` and the `$PORT` environment variable to a port used for staging. Your Synthetic tests run against the generated staging URL instead of running in production.

For example, you can write `https://www.example.org:81/path/to/something?abc=123#target` as:
For example, you can write `https://app.datadoghq.com/synthetics/details/abc-123-zyx?live=1h#test-results` as:

* `{{PROTOCOL}}//{{SUBDOMAIN}}.{{DOMAIN}}:{{PORT}}{{PATHNAME}}{{PARAMS}}{{HASH}}`
* `{{PROTOCOL}}//{{HOST}}{{PATHNAME}}{{PARAMS}}{{HASH}}`
Expand Down Expand Up @@ -356,7 +363,7 @@ The [@datadog/datadog-ci][1] NPM package also comes with secure tunnelling, allo
The testing tunnel creates an end-to-end encrypted HTTP proxy between your infrastructure and Datadog that allows all test requests sent through the CLI to be automatically routed through the `datadog-ci` client.
For more information, see [Testing Tunnel][4].
For more information, see [Testing Tunnel][3].
### Visualize test results
Expand All @@ -382,6 +389,6 @@ You can also see your CI test results listed in the [CI Results Explorer][5] and
[1]: https://www.npmjs.com/package/@datadog/datadog-ci
[2]: https://github.com/TooTallNate/node-proxy-agent
[3]: /api/latest/synthetics/#get-a-test-configuration
[4]: /synthetics/testing_tunnel/
[3]: /synthetics/testing_tunnel/
[4]: /api/latest/synthetics/#get-a-test-configuration
[5]: /synthetics/ci_results_explorer

0 comments on commit 1571ad0

Please sign in to comment.