Skip to content

Commit a76901c

Browse files
committed
test: support 9.* versions in smoketests
update smoketests to run with version 9
1 parent 0aee559 commit a76901c

File tree

9 files changed

+9
-32
lines changed

9 files changed

+9
-32
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ testing/smoke/**/tf.log
4747
testing/smoke/**/apm-server-*.ndjson
4848
testing/smoke/**/provisioner_key*
4949
testing/smoke/**/main.tf
50+
testing/smoke/**/secret_token_value.json
5051
!testing/smoke/main.tf
5152
!testing/smoke/supported-os/main.tf
5253
!testing/smoke/managed/main.tf

testing/infra/terraform/modules/ec_deployment/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ scripts/secret_token.sh
33
scripts/index_shards.sh
44
scripts/custom-apm-integration-pkg.sh
55
scripts/drop_pipeline.sh
6+
response.txt

testing/infra/terraform/modules/standalone_apm_server/latest_apm_server.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eo pipefail
44

55
VERSION=${1}
66
if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then
7-
VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '[.versions[] | select(. | startswith("8"))] | last')
7+
VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]')
88
fi
99
LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/" | jq -r '.builds[0]')
1010

testing/infra/terraform/modules/standalone_apm_server/latest_elastic_agent.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eo pipefail
44

55
VERSION=${1}
66
if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then
7-
VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '[.versions[] | select(. | startswith("8"))] | last')
7+
VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]')
88
fi
99
LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/" | jq -r '.builds[0]')
1010

testing/smoke/basic-upgrade/test.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ fi
1616
MAJOR_VERSION=$(echo ${VERSION} | cut -d '.' -f1 )
1717
MINOR_VERSION=$(echo ${VERSION} | cut -d '.' -f2 )
1818

19-
if [[ ${MAJOR_VERSION} -eq 7 ]]; then
20-
ASSERT_EVENTS_FUNC=legacy_assertions
21-
INTEGRATIONS_SERVER=false
22-
get_latest_patch "${MAJOR_VERSION}.${MINOR_VERSION}"
23-
LATEST_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${LATEST_PATCH}
24-
PREV_LATEST_VERSION=$(echo ${MAJOR_VERSION}.${MINOR_VERSION}.$(( ${LATEST_PATCH} -1 )))
25-
elif [[ ${MAJOR_VERSION} -eq 8 ]]; then
19+
if [[ ${MAJOR_VERSION} -eq 8 ]] || [[ ${MAJOR_VERSION} -eq 9 ]]; then
2620
ASSERT_EVENTS_FUNC=data_stream_assertions
2721
INTEGRATIONS_SERVER=true
2822

testing/smoke/legacy-standalone-major-managed/test.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ if [[ "${1}" == "latest" ]]; then
1717
LATEST_VERSION=${LATEST_SNAPSHOT_VERSION}
1818
ASSERTION_VERSION=${LATEST_SNAPSHOT_VERSION%-*} # strip -SNAPSHOT suffix
1919
get_latest_snapshot
20-
# NOTE(marclop) Temporarily avoid testing against 9.x, since we want to test that the
21-
# upgrade for 7.17 to 8.latest works correctly.
22-
# Uncomment the line below when we are ready to test against 9.x and delete the line
23-
# after the next one.
24-
# NEXT_MAJOR_LATEST=$(echo $VERSIONS | jq -r -c '.[-1]')
25-
NEXT_MAJOR_LATEST=$(echo ${VERSIONS} | jq -r '[.[] | select(. | startswith("8"))] | last')
20+
NEXT_MAJOR_LATEST=$(echo $VERSIONS | jq -r -c '.[-1]')
2621
ASSERTION_NEXT_MAJOR_LATEST=${NEXT_MAJOR_LATEST%-*} # strip -SNAPSHOT suffix
2722
else
2823
get_latest_patch ${VERSION}

testing/smoke/lib.sh

-4
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,6 @@ data_stream_assertions() {
337337
MAJOR=$(echo $VERSION | cut -d. -f1)
338338
MINOR=$(echo $VERSION | cut -d. -f2)
339339

340-
# Starting from 8.15 we use data stream lifecycle management.
341-
if [ $MAJOR -eq 8 ] && [ $MINOR -lt 15 ] || [ $MAJOR -lt 8 ]; then
342-
data_stream_assert_templates_ilm ${VERSION}
343-
fi
344340
data_stream_assert_pipelines
345341
data_stream_assert_events ${VERSION} ${ENTRIES}
346342
}

testing/smoke/supported-os/test.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,4 @@
22

33
set -eo pipefail
44

5-
# NOTE(marclop) temporarily avoid testing against 9.x, since it's currently in
6-
# its infancy and very far out.
7-
# Remove this line when we are ready to test against 9.x and the ${VERSION}
8-
# argument in the test_supported_os.sh script.
9-
VERSION=latest
10-
. $(git rev-parse --show-toplevel)/testing/smoke/test_supported_os.sh ${VERSION}
5+
. $(git rev-parse --show-toplevel)/testing/smoke/test_supported_os.sh

testing/smoke/test_supported_os.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,15 @@ get_latest_snapshot
1414

1515
VERSION=${1}
1616
if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then
17-
# NOTE(marclop) Temporarily avoid testing against 9.x, since we want to test that the
18-
# upgrade for 7.17 to 8.latest works correctly.
19-
# Uncomment the line below when we are ready to test against 9.x and delete the line
20-
# after the next one.
21-
# VERSION=$(echo ${VERSIONS} | jq -r 'last')
22-
VERSION=$(echo ${VERSIONS} | jq -r '[.[] | select(. | startswith("8"))] | last')
17+
VERSION=$(echo ${VERSIONS} | jq -r 'last')
2318
echo "-> unspecified version, using $(echo ${VERSION} | cut -d '.' -f1-2)"
2419
fi
2520
MAJOR_VERSION=$(echo ${VERSION} | cut -d '.' -f1 )
2621
MINOR_VERSION=$(echo ${VERSION} | cut -d '.' -f2 )
2722

2823
OBSERVER_VERSION=$(echo ${VERSION} | cut -d '-' -f1 )
2924

30-
if [[ ${MAJOR_VERSION} -eq 8 ]]; then
25+
if [[ ${MAJOR_VERSION} -eq 8 ]] || [[ ${MAJOR_VERSION} -eq 9 ]]; then
3126
ASSERT_EVENTS_FUNC=data_stream_assertions
3227
INTEGRATIONS_SERVER=true
3328

0 commit comments

Comments
 (0)