Skip to content

Commit

Permalink
Add test collector plugin for Buildkite analytics (#3927)
Browse files Browse the repository at this point in the history
* Update pre-command

* Update pipeline.yml

* Update token path

* Update pipeline.yml

* Add e2e tests to test collector

* Add BK analytics token for e2e tests

* Set test collector to only run on main
  • Loading branch information
rowlandgeoff authored Oct 15, 2024
1 parent 474d715 commit fe5697b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "fleet-server" && "$BUILDKITE_STEP_KEY" == "
export EC_API_KEY=${EC_API_KEY_SECRET}
fi

# BK analytics
if [[ "$BUILDKITE_PIPELINE_SLUG" == "fleet-server" ]]; then
if [[ "$BUILDKITE_STEP_KEY" == "int-test" || "$BUILDKITE_STEP_KEY" == "e2e-test" ]]; then
echo "--- Prepare BK test analytics token :vault:"
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_fleet_server_analytics_token)
export BUILDKITE_ANALYTICS_TOKEN
fi
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "fleet-server" && "$BUILDKITE_STEP_KEY" == "release-test" ]]; then
export PRIVATE_CI_GCS_CREDENTIALS_SECRET=$(retry 5 vault kv get -field plaintext -format=json ${PRIVATE_CI_GCS_CREDENTIALS_PATH})
export JOB_GCS_BUCKET
Expand Down
12 changes: 12 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ steps:
provider: "gcp"
artifact_paths:
- build/*.xml
plugins:
- test-collector#v1.10.2:
files: "build/test-*.xml"
format: "junit"
branches: "main"
debug: true

- label: "E2E Test"
key: "e2e-test"
Expand All @@ -114,6 +120,12 @@ steps:
artifact_paths:
- build/*.xml
- build/e2e-coverage.out
plugins:
- test-collector#v1.10.2:
files: "build/test-*.xml"
format: "junit"
branches: "main"
debug: true

- label: ":junit: Junit annotate"
plugins:
Expand Down

0 comments on commit fe5697b

Please sign in to comment.