Skip to content

Commit 8805150

Browse files
committed
f
1 parent 69a7648 commit 8805150

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

e2e/install_test.go

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ func TestOldVersionUpgrade(t *testing.T) {
666666
func TestSingleNodeAirgapUpgrade(t *testing.T) {
667667
t.Parallel()
668668

669-
RequireEnvVars(t, []string{"SHORT_SHA"})
669+
RequireEnvVars(t, []string{"SHORT_SHA", "AIRGAP_LICENSE_ID"})
670670

671671
t.Logf("%s: downloading airgap files", time.Now().Format(time.RFC3339))
672672
airgapInstallBundlePath := "/tmp/airgap-install-bundle.tar.gz"
@@ -756,8 +756,12 @@ func TestSingleNodeAirgapUpgrade(t *testing.T) {
756756
t.Fatalf("fail to remove airgap bundle on node %s: %v", tc.Nodes[0], err)
757757
}
758758

759-
if _, _, err := runPlaywrightTest(t, tc, "deploy-airgap-upgrade"); err != nil {
760-
t.Fatalf("fail to run playwright test deploy-airgap-upgrade: %v", err)
759+
appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA"))
760+
testArgs := []string{appUpgradeVersion}
761+
762+
t.Logf("%s: upgrading cluster", time.Now().Format(time.RFC3339))
763+
if _, _, err := runPlaywrightTest(t, tc, "deploy-upgrade", testArgs...); err != nil {
764+
t.Fatalf("fail to run playwright test deploy-app: %v", err)
761765
}
762766

763767
t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339))
@@ -772,7 +776,7 @@ func TestSingleNodeAirgapUpgrade(t *testing.T) {
772776
func TestSingleNodeAirgapUpgradeCustomCIDR(t *testing.T) {
773777
t.Parallel()
774778

775-
RequireEnvVars(t, []string{"SHORT_SHA"})
779+
RequireEnvVars(t, []string{"SHORT_SHA", "AIRGAP_LICENSE_ID"})
776780

777781
t.Logf("%s: downloading airgap files", time.Now().Format(time.RFC3339))
778782
airgapInstallBundlePath := "/tmp/airgap-install-bundle.tar.gz"
@@ -864,8 +868,12 @@ func TestSingleNodeAirgapUpgradeCustomCIDR(t *testing.T) {
864868
t.Fatalf("fail to remove airgap bundle on node %s: %v", tc.Nodes[0], err)
865869
}
866870

867-
if _, _, err := runPlaywrightTest(t, tc, "deploy-airgap-upgrade"); err != nil {
868-
t.Fatalf("fail to run playwright test deploy-airgap-upgrade: %v", err)
871+
appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA"))
872+
testArgs := []string{appUpgradeVersion}
873+
874+
t.Logf("%s: upgrading cluster", time.Now().Format(time.RFC3339))
875+
if _, _, err := runPlaywrightTest(t, tc, "deploy-upgrade", testArgs...); err != nil {
876+
t.Fatalf("fail to run playwright test deploy-app: %v", err)
869877
}
870878

871879
t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339))
@@ -888,7 +896,7 @@ func TestSingleNodeAirgapUpgradeCustomCIDR(t *testing.T) {
888896
func TestMultiNodeAirgapUpgradeSameK0s(t *testing.T) {
889897
t.Parallel()
890898

891-
RequireEnvVars(t, []string{"SHORT_SHA"})
899+
RequireEnvVars(t, []string{"SHORT_SHA", "AIRGAP_LICENSE_ID"})
892900

893901
t.Logf("%s: downloading airgap files", time.Now().Format(time.RFC3339))
894902
airgapInstallBundlePath := "/tmp/airgap-install-bundle.tar.gz"
@@ -1040,8 +1048,12 @@ func TestMultiNodeAirgapUpgradeSameK0s(t *testing.T) {
10401048
t.Fatalf("fail to remove embedded-cluster-upgrade binary on node %s: %v", tc.Nodes[0], err)
10411049
}
10421050

1043-
if _, _, err := runPlaywrightTest(t, tc, "deploy-airgap-upgrade", "true"); err != nil {
1044-
t.Fatalf("fail to run playwright test deploy-airgap-upgrade: %v", err)
1051+
appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA"))
1052+
testArgs := []string{appUpgradeVersion, "true"} // true to indicate that this
1053+
1054+
t.Logf("%s: upgrading cluster", time.Now().Format(time.RFC3339))
1055+
if _, _, err := runPlaywrightTest(t, tc, "deploy-upgrade", testArgs...); err != nil {
1056+
t.Fatalf("fail to run playwright test deploy-app: %v", err)
10451057
}
10461058

10471059
t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339))
@@ -1056,7 +1068,7 @@ func TestMultiNodeAirgapUpgradeSameK0s(t *testing.T) {
10561068
func TestMultiNodeAirgapUpgrade(t *testing.T) {
10571069
t.Parallel()
10581070

1059-
RequireEnvVars(t, []string{"SHORT_SHA"})
1071+
RequireEnvVars(t, []string{"SHORT_SHA", "AIRGAP_LICENSE_ID"})
10601072

10611073
t.Logf("%s: downloading airgap files", time.Now().Format(time.RFC3339))
10621074
airgapInstallBundlePath := "/tmp/airgap-install-bundle.tar.gz"
@@ -1200,8 +1212,12 @@ func TestMultiNodeAirgapUpgrade(t *testing.T) {
12001212
t.Fatalf("fail to remove embedded-cluster-upgrade binary on node %s: %v", tc.Nodes[0], err)
12011213
}
12021214

1203-
if _, _, err := runPlaywrightTest(t, tc, "deploy-airgap-upgrade"); err != nil {
1204-
t.Fatalf("fail to run playwright test deploy-airgap-upgrade: %v", err)
1215+
appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA"))
1216+
testArgs := []string{appUpgradeVersion}
1217+
1218+
t.Logf("%s: upgrading cluster", time.Now().Format(time.RFC3339))
1219+
if _, _, err := runPlaywrightTest(t, tc, "deploy-upgrade", testArgs...); err != nil {
1220+
t.Fatalf("fail to run playwright test deploy-app: %v", err)
12051221
}
12061222

12071223
t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339))
@@ -1492,7 +1508,7 @@ func TestMultiNodeAirgapHAInstallation(t *testing.T) {
14921508
func TestInstallSnapshotFromReplicatedApp(t *testing.T) {
14931509
t.Parallel()
14941510

1495-
RequireEnvVars(t, []string{"SHORT_SHA"})
1511+
RequireEnvVars(t, []string{"SHORT_SHA", "SNAPSHOT_LICENSE_ID"})
14961512

14971513
tc := cluster.NewTestCluster(&cluster.Input{
14981514
T: t,

e2e/restore_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ func TestSingleNodeResumeDisasterRecovery(t *testing.T) {
235235

236236
func TestSingleNodeAirgapDisasterRecovery(t *testing.T) {
237237
t.Parallel()
238+
239+
RequireEnvVars(t, []string{"SHORT_SHA", "AIRGAP_SNAPSHOT_LICENSE_ID"})
240+
238241
requiredEnvVars := []string{
239242
"DR_AWS_S3_ENDPOINT",
240243
"DR_AWS_S3_REGION",
@@ -378,8 +381,12 @@ func TestSingleNodeAirgapDisasterRecovery(t *testing.T) {
378381
t.Fatalf("fail to remove airgap bundle on node %s: %v", tc.Nodes[0], err)
379382
}
380383

381-
if _, _, err := runPlaywrightTest(t, tc, "deploy-airgap-upgrade"); err != nil {
382-
t.Fatalf("fail to run playwright test deploy-airgap-upgrade: %v", err)
384+
appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA"))
385+
testArgs = []string{appUpgradeVersion}
386+
387+
t.Logf("%s: upgrading cluster", time.Now().Format(time.RFC3339))
388+
if _, _, err := runPlaywrightTest(t, tc, "deploy-upgrade", testArgs...); err != nil {
389+
t.Fatalf("fail to run playwright test deploy-app: %v", err)
383390
}
384391

385392
t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339))

e2e/scripts/playwright.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ main() {
1717
export DR_AWS_SECRET_ACCESS_KEY="$7"
1818
elif [ "$test_name" == "deploy-upgrade" ]; then
1919
export APP_UPGRADE_VERSION="$2"
20-
fi
2120

22-
# if we have a second argument and the first points to the
23-
# deploy-airgap-upgrade script we set the env variable to
24-
# make the test skip the "Cluster update in progress" check.
25-
if [ $# -ge 2 ] && [ "$test_name" == "deploy-airgap-upgrade" ]; then
26-
export SKIP_CLUSTER_UPGRADING_CHECK="$2"
21+
# make the test skip the "Cluster update in progress" check.
22+
if [ $# -ge 3 ] && [ "$3" == "true" ]; then
23+
export SKIP_CLUSTER_UPGRADING_CHECK="true" # TODO
24+
fi
2725
fi
2826

27+
2928
export BASE_URL="http://10.0.0.2:30001"
3029
cd /automation/playwright
3130
npx playwright test "$test_name"

0 commit comments

Comments
 (0)