Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] [APM] Update testing dev doc (#119804) #120469

Merged
merged 1 commit into from
Dec 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion x-pack/plugins/apm/dev_docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,44 @@ API tests are separated in two suites:
- a basic license test suite [default]
- a trial license test suite (the equivalent of gold+)

### Run tests with [--trial] license

```
node scripts/test/api [--trial] [--help]
```

The above command will initiate an Elasticsearch instance on http://localhost:9220 and a kibana instance on http://localhost:5620 and will run the api test against these environments.
Once the tests finish, the instances will be terminated.

### Start test server

```
node scripts/test/api --server
```
Start Elasticsearch and Kibana instances.

### Run all tests

```
node scripts/test/api --runner
```
Run all tests. The test server needs to be running, see [Start Test Server](#start-test-server).

### Update snapshots (from Kibana root)

To update snapshots append `--updateSnapshots` to the `functional_test_runner` command

```
node scripts/functional_test_runner --config x-pack/test/apm_api_integration/[basic | trial]/config.ts --quiet --updateSnapshots
```
The test server needs to be running, see [Start Test Server](#start-test-server).

The API tests are located in [`x-pack/test/apm_api_integration/`](/x-pack/test/apm_api_integration/).

**API Test tips**

- For data generation in API tests have a look at the [elastic-apm-synthtrace](../../../../packages/elastic-apm-synthtrace/README.md) package
- For debugging access Elasticsearch on http://localhost:9220 and Kibana on http://localhost:5620 (`elastic` / `changeme`)
- To update snapshots append `--updateSnapshots` to the functional_test_runner command

---

Expand Down