Skip to content

Commit ea088a4

Browse files
authored
functionaltests: Add upgradable to stack version (#16686)
1 parent cf95435 commit ea088a4

File tree

14 files changed

+311
-169
lines changed

14 files changed

+311
-169
lines changed

functionaltests/8_16_test.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ import (
3131

3232
func TestUpgrade_8_15_to_8_16_Snapshot(t *testing.T) {
3333
t.Parallel()
34+
from := getLatestSnapshot(t, "8.15")
35+
to := getLatestSnapshot(t, "8.16")
36+
if !from.CanUpgradeTo(to.Version) {
37+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
38+
return
39+
}
3440

3541
scenarios := basicUpgradeLazyRolloverDSLTestScenarios(
36-
getLatestSnapshot(t, "8.15"),
37-
getLatestSnapshot(t, "8.16"),
42+
from.Version,
43+
to.Version,
3844
apmErrorLogs{
3945
tlsHandshakeError,
4046
esReturnedUnknown503,
@@ -56,10 +62,16 @@ func TestUpgrade_8_15_to_8_16_Snapshot(t *testing.T) {
5662

5763
func TestUpgrade_8_15_to_8_16_BC(t *testing.T) {
5864
t.Parallel()
65+
from := getLatestVersionOrSkip(t, "8.15")
66+
to := getLatestBCOrSkip(t, "8.16")
67+
if !from.CanUpgradeTo(to.Version) {
68+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
69+
return
70+
}
5971

6072
scenarios := basicUpgradeLazyRolloverDSLTestScenarios(
61-
getLatestVersionOrSkip(t, "8.15"),
62-
getLatestBCOrSkip(t, "8.16"),
73+
from.Version,
74+
to.Version,
6375
apmErrorLogs{
6476
tlsHandshakeError,
6577
esReturnedUnknown503,

functionaltests/8_17_test.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ import (
3333

3434
func TestUpgrade_8_16_to_8_17_Snapshot(t *testing.T) {
3535
t.Parallel()
36+
from := getLatestSnapshot(t, "8.16")
37+
to := getLatestSnapshot(t, "8.17")
38+
if !from.CanUpgradeTo(to.Version) {
39+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
40+
return
41+
}
3642

3743
scenarios := allBasicUpgradeScenarios(
38-
getLatestSnapshot(t, "8.16"),
39-
getLatestSnapshot(t, "8.17"),
44+
from.Version,
45+
to.Version,
4046
// Data streams managed by DSL pre-upgrade.
4147
asserts.CheckDataStreamsWant{
4248
Quantity: 8,
@@ -80,10 +86,16 @@ func TestUpgrade_8_16_to_8_17_Snapshot(t *testing.T) {
8086

8187
func TestUpgrade_8_16_to_8_17_BC(t *testing.T) {
8288
t.Parallel()
89+
from := getLatestVersionOrSkip(t, "8.16")
90+
to := getLatestBCOrSkip(t, "8.17")
91+
if !from.CanUpgradeTo(to.Version) {
92+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
93+
return
94+
}
8395

8496
scenarios := allBasicUpgradeScenarios(
85-
getLatestVersionOrSkip(t, "8.16"),
86-
getLatestBCOrSkip(t, "8.17"),
97+
from.Version,
98+
to.Version,
8799
// Data streams managed by DSL pre-upgrade.
88100
asserts.CheckDataStreamsWant{
89101
Quantity: 8,

functionaltests/8_18_test.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ import (
2323

2424
func TestUpgrade_8_17_to_8_18_Snapshot(t *testing.T) {
2525
t.Parallel()
26+
from := getLatestSnapshot(t, "8.17")
27+
to := getLatestSnapshot(t, "8.18")
28+
if !from.CanUpgradeTo(to.Version) {
29+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
30+
return
31+
}
2632

2733
scenarios := basicUpgradeILMTestScenarios(
28-
getLatestSnapshot(t, "8.17"),
29-
getLatestSnapshot(t, "8.18"),
34+
from.Version,
35+
to.Version,
3036
apmErrorLogs{
3137
tlsHandshakeError,
3238
esReturnedUnknown503,
@@ -44,10 +50,16 @@ func TestUpgrade_8_17_to_8_18_Snapshot(t *testing.T) {
4450

4551
func TestUpgrade_8_17_to_8_18_BC(t *testing.T) {
4652
t.Parallel()
53+
from := getLatestVersionOrSkip(t, "8.17")
54+
to := getLatestBCOrSkip(t, "8.18")
55+
if !from.CanUpgradeTo(to.Version) {
56+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
57+
return
58+
}
4759

4860
scenarios := basicUpgradeILMTestScenarios(
49-
getLatestVersionOrSkip(t, "8.17"),
50-
getLatestBCOrSkip(t, "8.18"),
61+
from.Version,
62+
to.Version,
5163
apmErrorLogs{
5264
tlsHandshakeError,
5365
esReturnedUnknown503,

functionaltests/8_19_test.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ import (
2828

2929
func TestUpgrade_8_18_to_8_19_Snapshot(t *testing.T) {
3030
t.Parallel()
31+
from := getLatestSnapshot(t, "8.18")
32+
to := getLatestSnapshot(t, "8.19")
33+
if !from.CanUpgradeTo(to.Version) {
34+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
35+
return
36+
}
3137

3238
scenarios := basicUpgradeLazyRolloverILMTestScenarios(
33-
getLatestSnapshot(t, "8.18"),
34-
getLatestSnapshot(t, "8.19"),
39+
from.Version,
40+
to.Version,
3541
apmErrorLogs{
3642
tlsHandshakeError,
3743
esReturnedUnknown503,
@@ -49,10 +55,16 @@ func TestUpgrade_8_18_to_8_19_Snapshot(t *testing.T) {
4955

5056
func TestUpgrade_8_18_to_8_19_BC(t *testing.T) {
5157
t.Parallel()
58+
from := getLatestVersionOrSkip(t, "8.18")
59+
to := getLatestBCOrSkip(t, "8.19")
60+
if !from.CanUpgradeTo(to.Version) {
61+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
62+
return
63+
}
5264

5365
scenarios := basicUpgradeLazyRolloverILMTestScenarios(
54-
getLatestVersionOrSkip(t, "8.18"),
55-
getLatestBCOrSkip(t, "8.19"),
66+
from.Version,
67+
to.Version,
5668
apmErrorLogs{
5769
tlsHandshakeError,
5870
esReturnedUnknown503,

functionaltests/8_x_test.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,43 @@ import (
2525
)
2626

2727
func TestUpgrade_7_17_to_8_x_Snapshot_Standalone_to_Managed(t *testing.T) {
28-
fromVersion := getLatestSnapshot(t, "7.17")
29-
toVersion := getLatestSnapshot(t, "8")
28+
from := getLatestSnapshot(t, "7.17")
29+
to := getLatestSnapshot(t, "8")
30+
if !from.CanUpgradeTo(to.Version) {
31+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
32+
return
33+
}
3034

3135
t.Run("UpgradeFirst", func(t *testing.T) {
3236
t.Parallel()
33-
runner := upgradeThenManaged78Runner(fromVersion, toVersion)
37+
runner := upgradeThenManaged78Runner(from.Version, to.Version)
3438
runner.Run(t)
3539
})
3640

3741
t.Run("ManagedFirst", func(t *testing.T) {
3842
t.Parallel()
39-
runner := managedThenUpgrade78Runner(fromVersion, toVersion)
43+
runner := managedThenUpgrade78Runner(from.Version, to.Version)
4044
runner.Run(t)
4145
})
4246
}
4347

4448
func TestUpgrade_7_17_to_8_x_BC_Standalone_to_Managed(t *testing.T) {
45-
fromVersion := getLatestVersionOrSkip(t, "7.17")
46-
toVersion := getLatestBCOrSkip(t, "8")
49+
from := getLatestVersionOrSkip(t, "7.17")
50+
to := getLatestBCOrSkip(t, "8")
51+
if !from.CanUpgradeTo(to.Version) {
52+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
53+
return
54+
}
4755

4856
t.Run("UpgradeFirst", func(t *testing.T) {
4957
t.Parallel()
50-
runner := upgradeThenManaged78Runner(fromVersion, toVersion)
58+
runner := upgradeThenManaged78Runner(from.Version, to.Version)
5159
runner.Run(t)
5260
})
5361

5462
t.Run("ManagedFirst", func(t *testing.T) {
5563
t.Parallel()
56-
runner := managedThenUpgrade78Runner(fromVersion, toVersion)
64+
runner := managedThenUpgrade78Runner(from.Version, to.Version)
5765
runner.Run(t)
5866
})
5967
}

functionaltests/9_0_test.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ import (
2323

2424
func TestUpgrade_8_18_to_9_0_Snapshot(t *testing.T) {
2525
t.Parallel()
26+
from := getLatestSnapshot(t, "8.18")
27+
to := getLatestSnapshot(t, "9.0")
28+
if !from.CanUpgradeTo(to.Version) {
29+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
30+
return
31+
}
2632

2733
scenarios := basicUpgradeILMTestScenarios(
28-
getLatestSnapshot(t, "8.18"),
29-
getLatestSnapshot(t, "9.0"),
34+
from.Version,
35+
to.Version,
3036
apmErrorLogs{
3137
tlsHandshakeError,
3238
esReturnedUnknown503,
@@ -45,10 +51,16 @@ func TestUpgrade_8_18_to_9_0_Snapshot(t *testing.T) {
4551

4652
func TestUpgrade_8_18_to_9_0_BC(t *testing.T) {
4753
t.Parallel()
54+
from := getLatestVersionOrSkip(t, "8.18")
55+
to := getLatestBCOrSkip(t, "9.0")
56+
if !from.CanUpgradeTo(to.Version) {
57+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
58+
return
59+
}
4860

4961
scenarios := basicUpgradeILMTestScenarios(
50-
getLatestVersionOrSkip(t, "8.18"),
51-
getLatestBCOrSkip(t, "9.0"),
62+
from.Version,
63+
to.Version,
5264
apmErrorLogs{
5365
tlsHandshakeError,
5466
esReturnedUnknown503,

functionaltests/9_1_test.go

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ import (
2828

2929
func TestUpgrade_9_0_to_9_1_Snapshot(t *testing.T) {
3030
t.Parallel()
31+
from := getLatestSnapshot(t, "9.0")
32+
to := getLatestSnapshot(t, "9.1")
33+
if !from.CanUpgradeTo(to.Version) {
34+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
35+
return
36+
}
3137

3238
scenarios := basicUpgradeLazyRolloverILMTestScenarios(
33-
getLatestSnapshot(t, "9.0"),
34-
getLatestSnapshot(t, "9.1"),
39+
from.Version,
40+
to.Version,
3541
apmErrorLogs{
3642
tlsHandshakeError,
3743
esReturnedUnknown503,
@@ -51,10 +57,16 @@ func TestUpgrade_9_0_to_9_1_Snapshot(t *testing.T) {
5157

5258
func TestUpgrade_9_0_to_9_1_BC(t *testing.T) {
5359
t.Parallel()
60+
from := getLatestVersionOrSkip(t, "9.0")
61+
to := getLatestBCOrSkip(t, "9.1")
62+
if !from.CanUpgradeTo(to.Version) {
63+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
64+
return
65+
}
5466

5567
scenarios := basicUpgradeLazyRolloverILMTestScenarios(
56-
getLatestVersionOrSkip(t, "9.0"),
57-
getLatestBCOrSkip(t, "9.1"),
68+
from.Version,
69+
to.Version,
5870
apmErrorLogs{
5971
tlsHandshakeError,
6072
esReturnedUnknown503,
@@ -74,10 +86,16 @@ func TestUpgrade_9_0_to_9_1_BC(t *testing.T) {
7486

7587
func TestUpgrade_8_19_to_9_1_Snapshot(t *testing.T) {
7688
t.Parallel()
89+
from := getLatestSnapshot(t, "8.19")
90+
to := getLatestSnapshot(t, "9.1")
91+
if !from.CanUpgradeTo(to.Version) {
92+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
93+
return
94+
}
7795

7896
scenarios := basicUpgradeILMTestScenarios(
79-
getLatestSnapshot(t, "8.19"),
80-
getLatestSnapshot(t, "9.1"),
97+
from.Version,
98+
to.Version,
8199
apmErrorLogs{
82100
tlsHandshakeError,
83101
esReturnedUnknown503,
@@ -97,10 +115,16 @@ func TestUpgrade_8_19_to_9_1_Snapshot(t *testing.T) {
97115

98116
func TestUpgrade_8_19_to_9_1_BC(t *testing.T) {
99117
t.Parallel()
118+
from := getLatestVersionOrSkip(t, "8.19")
119+
to := getLatestBCOrSkip(t, "9.1")
120+
if !from.CanUpgradeTo(to.Version) {
121+
t.Skipf("upgrade from %s to %s is not allowed", from.Version, to.Version)
122+
return
123+
}
100124

101125
scenarios := basicUpgradeILMTestScenarios(
102-
getLatestVersionOrSkip(t, "8.19"),
103-
getLatestBCOrSkip(t, "9.1"),
126+
from.Version,
127+
to.Version,
104128
apmErrorLogs{
105129
tlsHandshakeError,
106130
esReturnedUnknown503,

functionaltests/9_x_test.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,53 @@ import (
2525
)
2626

2727
func TestUpgrade_7_17_to_8_x_to_9_x__Snapshot_Standalone_to_Managed(t *testing.T) {
28-
fromVersion7 := getLatestSnapshot(t, "7.17")
29-
toVersion8 := getLatestSnapshot(t, "8")
30-
toVersion9 := getLatestSnapshot(t, "9")
28+
from7 := getLatestSnapshot(t, "7.17")
29+
to8 := getLatestSnapshot(t, "8")
30+
to9 := getLatestSnapshot(t, "9")
31+
if !from7.CanUpgradeTo(to8.Version) {
32+
t.Skipf("upgrade from %s to %s is not allowed", from7.Version, to8.Version)
33+
return
34+
}
35+
if !to8.CanUpgradeTo(to9.Version) {
36+
t.Skipf("upgrade from %s to %s is not allowed", to8.Version, to9.Version)
37+
return
38+
}
3139

3240
t.Run("UpgradeFirst", func(t *testing.T) {
3341
t.Parallel()
34-
runner := upgradeThenManaged789Runner(fromVersion7, toVersion8, toVersion9)
42+
runner := upgradeThenManaged789Runner(from7.Version, to8.Version, to9.Version)
3543
runner.Run(t)
3644
})
3745

3846
t.Run("ManagedFirst", func(t *testing.T) {
3947
t.Parallel()
40-
runner := managedThenUpgrade789Runner(fromVersion7, toVersion8, toVersion9)
48+
runner := managedThenUpgrade789Runner(from7.Version, to8.Version, to9.Version)
4149
runner.Run(t)
4250
})
4351
}
4452

4553
func TestUpgrade_7_17_to_8_x_to_9_x__BC_Standalone_to_Managed(t *testing.T) {
46-
fromVersion7 := getLatestVersionOrSkip(t, "7.17")
47-
toVersion8 := getLatestVersionOrSkip(t, "8")
48-
toVersion9 := getLatestBCOrSkip(t, "9")
54+
from7 := getLatestVersionOrSkip(t, "7.17")
55+
to8 := getLatestVersionOrSkip(t, "8")
56+
to9 := getLatestBCOrSkip(t, "9")
57+
if !from7.CanUpgradeTo(to8.Version) {
58+
t.Skipf("upgrade from %s to %s is not allowed", from7.Version, to8.Version)
59+
return
60+
}
61+
if !to8.CanUpgradeTo(to9.Version) {
62+
t.Skipf("upgrade from %s to %s is not allowed", to8.Version, to9.Version)
63+
return
64+
}
4965

5066
t.Run("UpgradeFirst", func(t *testing.T) {
5167
t.Parallel()
52-
runner := upgradeThenManaged789Runner(fromVersion7, toVersion8, toVersion9)
68+
runner := upgradeThenManaged789Runner(from7.Version, to8.Version, to9.Version)
5369
runner.Run(t)
5470
})
5571

5672
t.Run("ManagedFirst", func(t *testing.T) {
5773
t.Parallel()
58-
runner := managedThenUpgrade789Runner(fromVersion7, toVersion8, toVersion9)
74+
runner := managedThenUpgrade789Runner(from7.Version, to8.Version, to9.Version)
5975
runner.Run(t)
6076
})
6177
}

0 commit comments

Comments
 (0)