@@ -7,52 +7,77 @@ if [[ "${1}" != "7.17" && "${1}" != "latest" ]]; then
7
7
exit 0
8
8
fi
9
9
10
- . $( git rev-parse --show-toplevel) /testing/smoke/lib.sh
10
+ . " $( git rev-parse --show-toplevel) /testing/smoke/lib.sh"
11
11
12
- VERSION=7.17
13
- get_versions
12
+ VERSION_7=7.17
14
13
if [[ " ${1} " == " latest" ]]; then
15
- # a SNAPSHOT version can only be upgraded to another SNAPSHOT version
16
- get_latest_snapshot_for_version ${VERSION }
17
- LATEST_VERSION =${LATEST_SNAPSHOT_VERSION}
18
- ASSERTION_VERSION =${LATEST_SNAPSHOT_VERSION% -* } # strip -SNAPSHOT suffix
14
+ # SNAPSHOT version can only be upgraded to another SNAPSHOT version
15
+ get_latest_snapshot_for_version ${VERSION_7 }
16
+ LATEST_VERSION_7 =${LATEST_SNAPSHOT_VERSION}
17
+ ASSERTION_VERSION_7 =${LATEST_SNAPSHOT_VERSION% -* } # strip -SNAPSHOT suffix
19
18
get_latest_snapshot
20
- NEXT_MAJOR_LATEST=$( echo $VERSIONS | jq -r -c ' .[-1]' )
21
- ASSERTION_NEXT_MAJOR_LATEST=${NEXT_MAJOR_LATEST% -* } # strip -SNAPSHOT suffix
19
+ LATEST_VERSION_8=$( echo " ${VERSIONS} " | jq -r ' [.[] | select(. | startswith("8"))] | last' )
20
+ ASSERTION_VERSION_8=${LATEST_VERSION_8% -* } # strip -SNAPSHOT suffix
21
+ LATEST_VERSION_9=$( echo " ${VERSIONS} " | jq -r ' [.[] | select(. | startswith("9"))] | last' )
22
+ ASSERTION_VERSION_9=${LATEST_VERSION_9% -* } # strip -SNAPSHOT suffix
22
23
else
23
- get_latest_patch ${VERSION}
24
- LATEST_VERSION=${VERSION} .${LATEST_PATCH}
25
- ASSERTION_VERSION=${LATEST_VERSION}
26
- NEXT_MAJOR_LATEST=$( echo ${VERSIONS} | jq -r ' [.[] | select(. | startswith("8"))] | last' )
27
- ASSERTION_NEXT_MAJOR_LATEST=${NEXT_MAJOR_LATEST}
24
+ get_latest_patch ${VERSION_7}
25
+ LATEST_VERSION_7=${VERSION_7} .${LATEST_PATCH}
26
+ ASSERTION_VERSION_7=${LATEST_VERSION_7}
27
+ get_versions
28
+ LATEST_VERSION_8=$( echo " ${VERSIONS} " | jq -r ' [.[] | select(. | startswith("8"))] | last' )
29
+ ASSERTION_VERSION_8=${LATEST_VERSION_8}
30
+ LATEST_VERSION_9=$( echo " ${VERSIONS} " | jq -r ' [.[] | select(. | startswith("9"))] | last' )
31
+ ASSERTION_VERSION_9=${LATEST_VERSION_9}
28
32
fi
29
33
30
- echo " -> Running ${LATEST_VERSION} standalone to ${NEXT_MAJOR_LATEST} to ${NEXT_MAJOR_LATEST} managed"
34
+ if [[ -n ${LATEST_VERSION_9} ]]; then
35
+ echo " -> Running ${LATEST_VERSION_7} standalone to ${LATEST_VERSION_8} standalone to ${LATEST_VERSION_9} standalone to ${LATEST_VERSION_9} managed"
36
+ else
37
+ echo " -> Running ${LATEST_VERSION_7} standalone to ${LATEST_VERSION_8} standalone to ${LATEST_VERSION_8} managed"
38
+ fi
31
39
32
40
if [[ -z ${SKIP_DESTROY} ]]; then
33
41
trap " terraform_destroy" EXIT
34
42
fi
35
43
44
+ # Version 7
36
45
INTEGRATIONS_SERVER=false
37
46
cleanup_tfvar
38
- append_tfvar " stack_version" ${LATEST_VERSION}
47
+ append_tfvar " stack_version" " ${LATEST_VERSION_7} "
39
48
append_tfvar " integrations_server" ${INTEGRATIONS_SERVER}
40
49
terraform_apply
41
50
healthcheck 1
42
51
send_events
43
- legacy_assertions ${ASSERTION_VERSION}
52
+ legacy_assertions " ${ASSERTION_VERSION_7} "
44
53
54
+ # Version 8
45
55
cleanup_tfvar
46
- append_tfvar " stack_version" ${NEXT_MAJOR_LATEST}
56
+ append_tfvar " stack_version" " ${LATEST_VERSION_8} "
47
57
append_tfvar " integrations_server" ${INTEGRATIONS_SERVER}
48
58
terraform_apply
49
59
healthcheck 1
50
60
send_events
51
- data_stream_assertions ${ASSERTION_NEXT_MAJOR_LATEST}
61
+ data_stream_assertions " ${ASSERTION_VERSION_8} "
62
+
63
+ # Version 9 (if exists)
64
+ MANAGED_VERSION=" ${LATEST_VERSION_8} "
65
+ ASSERTION_MANAGED_VERSION=" ${ASSERTION_VERSION_8} "
66
+ if [[ -n ${LATEST_VERSION_9} ]]; then
67
+ cleanup_tfvar
68
+ append_tfvar " stack_version" " ${LATEST_VERSION_9} "
69
+ append_tfvar " integrations_server" ${INTEGRATIONS_SERVER}
70
+ terraform_apply
71
+ healthcheck 1
72
+ send_events
73
+ data_stream_assertions " ${ASSERTION_VERSION_9} "
74
+ MANAGED_VERSION=" ${LATEST_VERSION_9} "
75
+ ASSERTION_MANAGED_VERSION=" ${ASSERTION_VERSION_9} "
76
+ fi
52
77
53
- upgrade_managed ${NEXT_MAJOR_LATEST}
78
+ upgrade_managed " ${MANAGED_VERSION} "
54
79
healthcheck 1
55
80
send_events
56
81
# Assert there are 2 instances of the same event, since we ingested data twice
57
82
# using the same APM Server version.
58
- data_stream_assertions ${ASSERTION_NEXT_MAJOR_LATEST} 2
83
+ data_stream_assertions " ${ASSERTION_MANAGED_VERSION} " 2
0 commit comments