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

Add test collector plugin for Buildkite analytics #3927

Merged
merged 7 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
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
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no comment; we did in other repositories, but IMHO, it's not ideal either—except Beats, due to the nature of the pipelines.

The secret should be in a repository-scoped vault path rather than a shared vault path. This is a good idea because the secret makes sense only for this repository.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have repo-scoped vault paths that we use for CI?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading