From f37135ad55380b0a52c25257f6a9bf5bd853803a Mon Sep 17 00:00:00 2001 From: Marc Lopez Rubio Date: Thu, 26 Sep 2024 10:10:40 +0800 Subject: [PATCH] smoke tests: Ignore version 9.0.0 (#14176) Omits running the smoke tests against 9.0.0-SNAPSHOT, since the it's still in its infancy and other components aren't working properly at the moment. Given how far out the release is and that it breaks the smoke tests, it skips testing that version. --------- Signed-off-by: Marc Lopez Rubio --- .../modules/standalone_apm_server/latest_apm_server.sh | 2 +- .../modules/standalone_apm_server/latest_elastic_agent.sh | 2 +- testing/smoke/legacy-standalone-major-managed/test.sh | 7 ++++++- testing/smoke/supported-os/test.sh | 7 ++++++- testing/smoke/test_supported_os.sh | 7 ++++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/testing/infra/terraform/modules/standalone_apm_server/latest_apm_server.sh b/testing/infra/terraform/modules/standalone_apm_server/latest_apm_server.sh index 3946546080e..13596905bc4 100755 --- a/testing/infra/terraform/modules/standalone_apm_server/latest_apm_server.sh +++ b/testing/infra/terraform/modules/standalone_apm_server/latest_apm_server.sh @@ -4,7 +4,7 @@ set -eo pipefail VERSION=${1} if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then - VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]') + VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '[.versions[] | select(. | startswith("8"))] | last') fi LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/" | jq -r '.builds[0]') diff --git a/testing/infra/terraform/modules/standalone_apm_server/latest_elastic_agent.sh b/testing/infra/terraform/modules/standalone_apm_server/latest_elastic_agent.sh index 02df3188d5a..58c0112ad24 100755 --- a/testing/infra/terraform/modules/standalone_apm_server/latest_elastic_agent.sh +++ b/testing/infra/terraform/modules/standalone_apm_server/latest_elastic_agent.sh @@ -4,7 +4,7 @@ set -eo pipefail VERSION=${1} if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then - VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]') + VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '[.versions[] | select(. | startswith("8"))] | last') fi LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/" | jq -r '.builds[0]') diff --git a/testing/smoke/legacy-standalone-major-managed/test.sh b/testing/smoke/legacy-standalone-major-managed/test.sh index c22c1cd1ecd..3e5da98a1c1 100755 --- a/testing/smoke/legacy-standalone-major-managed/test.sh +++ b/testing/smoke/legacy-standalone-major-managed/test.sh @@ -17,7 +17,12 @@ if [[ "${1}" == "latest" ]]; then LATEST_VERSION=${LATEST_SNAPSHOT_VERSION} ASSERTION_VERSION=${LATEST_SNAPSHOT_VERSION%-*} # strip -SNAPSHOT suffix get_latest_snapshot - NEXT_MAJOR_LATEST=$(echo $VERSIONS | jq -r -c '.[-1]') + # NOTE(marclop) Temporarily avoid testing against 9.x, since we want to test that the + # upgrade for 7.17 to 8.latest works correctly. + # Uncomment the line below when we are ready to test against 9.x and delete the line + # after the next one. + # NEXT_MAJOR_LATEST=$(echo $VERSIONS | jq -r -c '.[-1]') + NEXT_MAJOR_LATEST=$(echo ${VERSIONS} | jq -r '[.[] | select(. | startswith("8"))] | last') ASSERTION_NEXT_MAJOR_LATEST=${NEXT_MAJOR_LATEST%-*} # strip -SNAPSHOT suffix else get_latest_patch ${VERSION} diff --git a/testing/smoke/supported-os/test.sh b/testing/smoke/supported-os/test.sh index b479743513f..b7b9a3f148c 100755 --- a/testing/smoke/supported-os/test.sh +++ b/testing/smoke/supported-os/test.sh @@ -2,4 +2,9 @@ set -eo pipefail -. $(git rev-parse --show-toplevel)/testing/smoke/test_supported_os.sh +# NOTE(marclop) temporarily avoid testing against 9.x, since it's currently in +# its infancy and very far out. +# Remove this line when we are ready to test against 9.x and the ${VERSION} +# argument in the test_supported_os.sh script. +VERSION=latest +. $(git rev-parse --show-toplevel)/testing/smoke/test_supported_os.sh ${VERSION} diff --git a/testing/smoke/test_supported_os.sh b/testing/smoke/test_supported_os.sh index 9249b1a5eb4..be3172429cc 100644 --- a/testing/smoke/test_supported_os.sh +++ b/testing/smoke/test_supported_os.sh @@ -14,7 +14,12 @@ get_latest_snapshot VERSION=${1} if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then - VERSION=$(echo ${VERSIONS} | jq -r 'last') + # NOTE(marclop) Temporarily avoid testing against 9.x, since we want to test that the + # upgrade for 7.17 to 8.latest works correctly. + # Uncomment the line below when we are ready to test against 9.x and delete the line + # after the next one. + # VERSION=$(echo ${VERSIONS} | jq -r 'last') + VERSION=$(echo ${VERSIONS} | jq -r '[.[] | select(. | startswith("8"))] | last') echo "-> unspecified version, using $(echo ${VERSION} | cut -d '.' -f1-2)" fi MAJOR_VERSION=$(echo ${VERSION} | cut -d '.' -f1 )