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

BK Integration tests: fix retry usage #5760

Merged
merged 9 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
2 changes: 1 addition & 1 deletion .buildkite/bk.integration.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp"
ASDF_MAGE_VERSION: 1.14.0
ASDF_GOLANG_VERSION: 1.22.6
ASDF_TERRAFORM_VERSION: 1.9.3
ASDF_TERRAFORM_VERSION: 1.9.2

steps:
- label: "Integration tests: packaging"
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/ess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ess_up() {
return 1
fi

export EC_API_KEY=$(retry 5 vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)
export EC_API_KEY=$(retry -t 5 -- vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)

if [[ -z "${EC_API_KEY}" ]]; then
echo "Error: Failed to get EC API key from vault" >&2
Expand Down Expand Up @@ -48,7 +48,7 @@ function ess_down() {
local WORKSPACE=$(git rev-parse --show-toplevel)
local TF_DIR="${WORKSPACE}/test_infra/ess/"
if [ -z "${EC_API_KEY:-}" ]; then
export EC_API_KEY=$(retry 5 vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)
export EC_API_KEY=$(retry -t 5 -- vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)
fi

pushd "${TF_DIR}"
Expand Down
7 changes: 5 additions & 2 deletions .buildkite/scripts/sudo-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ TESTS_TO_RUN=$2

echo "~~~ Running integration tests as $USER"
echo "~~~ Integration tests: ${GROUP_NAME}"
# TODO: Pass the actual version of the agen
gotestsum --version
PACKAGE_VERSION="$(cat .package-version)"
if [[ -n "$PACKAGE_VERSION" ]]; then
PACKAGE_VERSION=${PACKAGE_VERSION}"-SNAPSHOT"
fi
set +e
SNAPSHOT=true TEST_DEFINE_PREFIX="sudo_${GROUP_NAME}_ubuntu" gotestsum --no-color -f standard-quiet --junitfile "build/${GROUP_NAME}.integration.xml" --jsonfile "build/${GROUP_NAME}.integration.out.json" -- -tags integration -test.shuffle on -test.timeout 2h0m0s -test.run "${TESTS_TO_RUN}" github.com/elastic/elastic-agent/testing/integration
AGENT_VERSION="${PACKAGE_VERSION}" SNAPSHOT=true TEST_DEFINE_PREFIX="sudo_${GROUP_NAME}_ubuntu" gotestsum --no-color -f standard-quiet --junitfile "build/${GROUP_NAME}.integration.xml" --jsonfile "build/${GROUP_NAME}.integration.out.json" -- -tags integration -test.shuffle on -test.timeout 2h0m0s -test.run "${TESTS_TO_RUN}" github.com/elastic/elastic-agent/testing/integration
TESTS_EXIT_STATUS=$?
set -e

Expand Down