Skip to content

Commit

Permalink
Add BUILDKITE_ANALYTICS_TOKEN to buildkite integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pazone committed Nov 27, 2024
1 parent 4cbc18b commit ca786fd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ if [[ "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then
export API_KEY_TOKEN=$(vault kv get -field apiKey ${CI_ESS_PATH})
echo ${API_KEY_TOKEN} > ./apiKey
export TEST_INTEG_AUTH_ESS_APIKEY_FILE=$(realpath ./apiKey)

# BK analytics
echo "--- Prepare BK test analytics token :vault:"
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
export BUILDKITE_ANALYTICS_TOKEN

fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-binary-dra" ]]; then
Expand Down
6 changes: 6 additions & 0 deletions .buildkite/scripts/steps/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if [[ -n "$STACK_VERSION" ]]; then
STACK_VERSION=${STACK_VERSION}"-SNAPSHOT"
fi

# TODO: move to common.sh when it's refactored
# BK analytics
echo "--- Prepare BK test analytics token :vault:"
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
export BUILDKITE_ANALYTICS_TOKEN

# Run integration tests
set +e
AGENT_STACK_VERSION="${STACK_VERSION}" TEST_INTEG_CLEAN_ON_EXIT=true STACK_PROVISIONER="$STACK_PROVISIONER" SNAPSHOT=true mage $MAGE_TARGET $MAGE_SUBTARGET
Expand Down
6 changes: 6 additions & 0 deletions .buildkite/scripts/steps/integration_tests_tf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ else
export KIBANA_PASSWORD=$(buildkite-agent meta-data get "kibana.pwd")
fi

# TODO: move to common.sh when it's refactored
# BK analytics
echo "--- Prepare BK test analytics token :vault:"
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
export BUILDKITE_ANALYTICS_TOKEN

# Run integration tests
echo "~~~ Running integration tests"

Expand Down

0 comments on commit ca786fd

Please sign in to comment.