Skip to content

Commit

Permalink
Test with serverless
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodm committed Apr 30, 2024
1 parent 997839b commit bf0fe3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
11 changes: 4 additions & 7 deletions .buildkite/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ set -euo pipefail
# TODO: change pipeline slug
if [[ "${BUILDKITE_PIPELINE_SLUG}" == "elastic-package" && "${BUILDKITE_STEP_KEY}" == "test-serverless" ]]; then
echo "--- Take down the Elastic stack"
# already installed in pipeline step
# BUILDKITE resets PATH contents in pre-exit hook
ELASTIC_PACKAGE_BIN="${HOME}/go/bin/elastic-package"
echo "Test with variable"
${ELASTIC_PACKAGE_BIN} version

EC_API_KEY=${EC_API_KEY_SECRET} EC_HOST=${EC_HOST_SECRET} elastic-package stack down -v
# BUILDKITE resets PATH contents in pre-exit hook, but elastic-package
# is already installed in the test_serverless pipeline step, accessing
# directly to the binary
EC_API_KEY="${EC_API_KEY_SECRET}" EC_HOST="${EC_HOST_SECRET}" "${HOME}"/go/bin/elastic-package down -v
fi

unset_secrets
Expand Down
14 changes: 6 additions & 8 deletions .buildkite/scripts/test_packages_with_serverless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ echo "--- Install elastic-package"
# Required to start the Serverless Elastic stack
make install

# prepare_serverless_stack
#
# echo "Waiting time to avoid getaddrinfo ENOTFOUND errors..."
# sleep 120
# echo "Done."
prepare_serverless_stack

echo "Waiting time to avoid getaddrinfo ENOTFOUND errors..."
sleep 120
echo "Done."

list_packages() {
find test/packages/parallel -maxdepth 1 -mindepth 1 -type d | xargs -I {} basename {} | sort
Expand All @@ -46,9 +46,7 @@ list_packages() {
any_package_failing=0

for package in $(list_packages); do
# test
elastic-package -h
echo "--- Test package: ${pacckage}"
echo "--- Test package: ${package}"
if ! .buildkite/scripts/integration_tests.sh -t test-check-packages-parallel -p "${package}" -s ; then
echo "- ${package}" >> "${FAILED_PACKAGES_FILE_PATH}"
any_package_failing=1
Expand Down

0 comments on commit bf0fe3d

Please sign in to comment.