Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
oakrizan committed Dec 17, 2024
1 parent 174465c commit e73cd42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 33 deletions.
4 changes: 0 additions & 4 deletions .buildkite/bk.integration.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ env:
VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp"
ASDF_MAGE_VERSION: 1.14.0
ASDF_GOLANG_VERSION: 1.22.6
<<<<<<< HEAD
ASDF_TERRAFORM_VERSION: 1.9.2
=======
ASDF_TERRAFORM_VERSION: 1.9.3
>>>>>>> 7aa8bb222f (Ess terraform + run integration tests on BK agents (#5113))

steps:
- label: "Integration tests: packaging"
Expand Down
30 changes: 11 additions & 19 deletions .buildkite/scripts/steps/ess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@
set -euo pipefail

function ess_up() {
echo "~~~ Staring ESS Stack"
echo "~~~ Staring ESS Stack"
local WORKSPACE=$(git rev-parse --show-toplevel)
local TF_DIR="${WORKSPACE}/test_infra/ess/"
local STACK_VERSION=$1
local ESS_REGION=${2:-"gcp-us-west2"}

if [ -z "$STACK_VERSION" ]; then
echo "Error: Specify stack version: ess_up [stack_version]" >&2
return 1
fi

<<<<<<< HEAD
export EC_API_KEY=$(retry -t 5 -- vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)
=======
export EC_API_KEY=$(retry 5 vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)
>>>>>>> 7aa8bb222f (Ess terraform + run integration tests on BK agents (#5113))


if [[ -z "${EC_API_KEY}" ]]; then
echo "Error: Failed to get EC API key from vault" >&2
exit 1
Expand All @@ -27,8 +23,8 @@ function ess_up() {
BUILDKITE_BUILD_CREATOR="${BUILDKITE_BUILD_CREATOR:-"$(get_git_user_email)"}"
BUILDKITE_BUILD_NUMBER="${BUILDKITE_BUILD_NUMBER:-"0"}"
BUILDKITE_PIPELINE_SLUG="${BUILDKITE_PIPELINE_SLUG:-"elastic-agent-integration-tests"}"
pushd "${TF_DIR}"

pushd "${TF_DIR}"
terraform init
terraform apply \
-auto-approve \
Expand All @@ -48,17 +44,13 @@ function ess_up() {
}

function ess_down() {
echo "~~~ Tearing down the ESS Stack"
echo "~~~ Tearing down the ESS Stack"
local WORKSPACE=$(git rev-parse --show-toplevel)
local TF_DIR="${WORKSPACE}/test_infra/ess/"
if [ -z "${EC_API_KEY:-}" ]; then
<<<<<<< HEAD
export EC_API_KEY=$(retry -t 5 -- vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)
=======
export EC_API_KEY=$(retry 5 vault kv get -field=apiKey kv/ci-shared/platform-ingest/platform-ingest-ec-prod)
>>>>>>> 7aa8bb222f (Ess terraform + run integration tests on BK agents (#5113))
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}"
terraform init
terraform destroy -auto-approve
Expand All @@ -67,15 +59,15 @@ function ess_down() {

function get_git_user_email() {
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
echo "unknown"
echo "unknown"
return
fi

local email
email=$(git config --get user.email)

if [ -z "$email" ]; then
echo "unknown"
echo "unknown"
else
echo "$email"
fi
Expand Down
12 changes: 2 additions & 10 deletions .buildkite/scripts/sudo-integration-tests.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
#!/usr/bin/env bash

# The script is used to run integration tests with sudo
source /opt/buildkite-agent/hooks/pre-command
source /opt/buildkite-agent/hooks/pre-command
source .buildkite/hooks/pre-command || echo "No pre-command hook found"

GROUP_NAME=$1
TESTS_TO_RUN=$2

echo "~~~ Running integration tests as $USER"
echo "~~~ Integration tests: ${GROUP_NAME}"
<<<<<<< HEAD
gotestsum --version
PACKAGE_VERSION="$(cat .package-version)"
if [[ -n "$PACKAGE_VERSION" ]]; then
PACKAGE_VERSION=${PACKAGE_VERSION}"-SNAPSHOT"
fi
# TODO: Pass the actual version of the agen
set +e
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
=======
# TODO: Pass the actual version of the agen
gotestsum --version
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
>>>>>>> 7aa8bb222f (Ess terraform + run integration tests on BK agents (#5113))
TESTS_EXIT_STATUS=$?
set -e

Expand Down

0 comments on commit e73cd42

Please sign in to comment.