[APM] Add parallel builds for cypress tests (#142598)

- Tests runs initiated by the flaky test runner are not recorded or
parallelized
This commit is contained in:
Giorgos Bamparopoulos 2022-12-21 15:36:08 +00:00 committed by GitHub
parent b3d7ecb68d
commit 042403e606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -5,6 +5,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
retry:
automatic:
- exit_status: '-1'

View file

@ -10,6 +10,14 @@ APM_CYPRESS_RECORD_KEY="$(retry 5 5 vault read -field=CYPRESS_RECORD_KEY secret/
.buildkite/scripts/download_build_artifacts.sh
export JOB=kibana-apm-cypress
IS_FLAKY_TEST_RUNNER=${CLI_COUNT:-0}
# Disable parallel tests and dashboard recording when running them in the flaky test runner
if [[ "$IS_FLAKY_TEST_RUNNER" -ne 1 ]]; then
CYPRESS_ARGS="--record --key "$APM_CYPRESS_RECORD_KEY" --parallel --ci-build-id "${BUILDKITE_BUILD_ID}""
else
CYPRESS_ARGS=""
fi
echo "--- APM Cypress Tests"
@ -17,5 +25,4 @@ cd "$XPACK_DIR"
node plugins/apm/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--record \
--key "$APM_CYPRESS_RECORD_KEY"
$CYPRESS_ARGS

View file

@ -70,7 +70,16 @@ node scripts/test/api --runner --basic --updateSnapshots
## E2E Tests (Cypress)
The E2E tests are located in [`x-pack/plugins/apm/ftr_e2e`](../ftr_e2e)
The E2E tests are located in [`x-pack/plugins/apm/ftr_e2e`](../ftr_e2e).
Test runs are recorded to the [Cypress Dashboard](https://dashboard.cypress.io). Tests run on buildkite PR pipeline are parallelized (4 parallel jobs) and are orchestrated by the Cypress dashboard service. It can be configured in [.buildkite/pipelines/pull_request/apm_cypress.yml](https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/pull_request/apm_cypress.yml) with the property `parallelism`.
```yml
...
depends_on: build
parallelism: 4
...
```
[Test tips and best practices](../ftr_e2e/README.md)