diff --git a/x-pack/plugins/apm/dev_docs/testing.md b/x-pack/plugins/apm/dev_docs/testing.md index 2a7533402ecca..f6a8298ef9d0c 100644 --- a/x-pack/plugins/apm/dev_docs/testing.md +++ b/x-pack/plugins/apm/dev_docs/testing.md @@ -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 ---