Skip to content

Commit 189070f

Browse files
authored
Remove unnecessary e2e tests - 5th pass (#3159)
1 parent 030261b commit 189070f

File tree

4 files changed

+42
-101
lines changed

4 files changed

+42
-101
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,6 @@ jobs:
884884
- TestSingleNodeUpgradePreviousStable
885885
- TestUpgradeFromReplicatedAppPreviousK0s
886886
- TestMultiNodeInstallation
887-
- TestMultiNodeHAInstallation
888887
- TestSingleNodeDisasterRecovery
889888
- TestSingleNodeLegacyDisasterRecovery
890889
- TestSingleNodeResumeDisasterRecovery

.github/workflows/release-prod.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ jobs:
495495
- TestSingleNodeInstallation
496496
- TestSingleNodeUpgradePreviousStable
497497
- TestMultiNodeInstallation
498-
- TestMultiNodeHAInstallation
499498
- TestSingleNodeDisasterRecovery
500499
- TestSingleNodeResumeDisasterRecovery
501500
- TestMultiNodeHADisasterRecovery

e2e/install_test.go

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -449,86 +449,6 @@ func TestMultiNodeAirgapUpgradePreviousStable(t *testing.T) {
449449
t.Logf("%s: test complete", time.Now().Format(time.RFC3339))
450450
}
451451

452-
// This test creates 4 nodes, installs on the first one and then generate 2 join tokens
453-
// for controllers and one join token for worker nodes. Joins the nodes as HA and then waits
454-
// for them to report ready. Runs additional high availability validations afterwards.
455-
func TestMultiNodeHAInstallation(t *testing.T) {
456-
tc := docker.NewCluster(&docker.ClusterInput{
457-
T: t,
458-
Nodes: 4,
459-
Distro: "debian-bookworm",
460-
LicensePath: "licenses/license.yaml",
461-
ECBinaryPath: "../output/bin/embedded-cluster",
462-
SupportBundleNodeIndex: 2,
463-
})
464-
defer tc.Cleanup()
465-
466-
installSingleNode(t, tc)
467-
468-
if stdout, stderr, err := tc.SetupPlaywrightAndRunTest("deploy-app"); err != nil {
469-
t.Fatalf("fail to run playwright test deploy-app: %v: %s: %s", err, stdout, stderr)
470-
}
471-
472-
// join a worker
473-
joinWorkerNode(t, tc, 1)
474-
475-
// join a controller
476-
joinControllerNode(t, tc, 2)
477-
478-
// join another controller in HA mode
479-
joinControllerNodeWithOptions(t, tc, 3, joinOptions{isHA: true})
480-
481-
// wait for the nodes to report as ready.
482-
waitForNodes(t, tc, 4, nil)
483-
484-
t.Logf("%s: checking installation state after enabling high availability", time.Now().Format(time.RFC3339))
485-
line := []string{"check-post-ha-state.sh", os.Getenv("SHORT_SHA"), k8sVersion()}
486-
if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil {
487-
t.Fatalf("fail to check post ha state: %v: %s: %s", err, stdout, stderr)
488-
}
489-
490-
appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA"))
491-
testArgs := []string{appUpgradeVersion}
492-
493-
t.Logf("%s: upgrading cluster", time.Now().Format(time.RFC3339))
494-
if stdout, stderr, err := tc.RunPlaywrightTest("deploy-upgrade", testArgs...); err != nil {
495-
t.Fatalf("fail to run playwright test deploy-upgrade: %v: %s: %s", err, stdout, stderr)
496-
}
497-
498-
checkPostUpgradeState(t, tc)
499-
500-
bin := "embedded-cluster"
501-
t.Logf("%s: resetting controller node 0", time.Now().Format(time.RFC3339))
502-
stdout, stderr, err := tc.RunCommandOnNode(0, []string{bin, "reset", "--yes"})
503-
if err != nil {
504-
t.Fatalf("fail to remove controller node 0: %v: %s: %s", err, stdout, stderr)
505-
}
506-
if !strings.Contains(stdout, "High-availability is enabled and requires at least three controller-test nodes") {
507-
t.Errorf("reset output does not contain the ha warning")
508-
t.Logf("stdout: %s\nstderr: %s", stdout, stderr)
509-
}
510-
511-
stdout, stderr, err = tc.RunCommandOnNode(2, []string{"check-nodes-removed.sh", "3"})
512-
if err != nil {
513-
t.Fatalf("fail to check nodes removed: %v: %s: %s", err, stdout, stderr)
514-
}
515-
516-
t.Logf("%s: checking nllb", time.Now().Format(time.RFC3339))
517-
line = []string{"check-nllb.sh"}
518-
if stdout, stderr, err := tc.RunCommandOnNode(2, line); err != nil {
519-
t.Fatalf("fail to check nllb: %v: %s: %s", err, stdout, stderr)
520-
}
521-
522-
checkPostUpgradeStateWithOptions(t, tc, postUpgradeStateOptions{
523-
node: 2,
524-
withEnv: map[string]string{
525-
"ALLOW_PENDING_PODS": "true",
526-
},
527-
})
528-
529-
t.Logf("%s: test complete", time.Now().Format(time.RFC3339))
530-
}
531-
532452
func TestSingleNodeInstallationNoopUpgrade(t *testing.T) {
533453
t.Parallel()
534454

e2e/restore_test.go

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ func TestMultiNodeHADisasterRecovery(t *testing.T) {
411411

412412
tc := docker.NewCluster(&docker.ClusterInput{
413413
T: t,
414-
Nodes: 3,
414+
Nodes: 4,
415415
Distro: "debian-bookworm",
416416
LicensePath: "licenses/snapshot-license.yaml",
417417
ECBinaryPath: "../output/bin/embedded-cluster",
@@ -424,14 +424,17 @@ func TestMultiNodeHADisasterRecovery(t *testing.T) {
424424
t.Fatalf("fail to run playwright test deploy-app: %v: %s: %s", err, stdout, stderr)
425425
}
426426

427+
// join a worker
428+
joinWorkerNode(t, tc, 1)
429+
427430
// join a controller
428-
joinControllerNode(t, tc, 1)
431+
joinControllerNode(t, tc, 2)
429432

430433
// join another controller in HA mode
431-
joinControllerNodeWithOptions(t, tc, 2, joinOptions{isHA: true})
434+
joinControllerNodeWithOptions(t, tc, 3, joinOptions{isHA: true})
432435

433436
// wait for the nodes to report as ready.
434-
waitForNodes(t, tc, 3, nil)
437+
waitForNodes(t, tc, 4, nil)
435438

436439
t.Logf("%s: checking installation state after enabling high availability", time.Now().Format(time.RFC3339))
437440
line := []string{"check-post-ha-state.sh", os.Getenv("SHORT_SHA"), k8sVersion()}
@@ -443,24 +446,46 @@ func TestMultiNodeHADisasterRecovery(t *testing.T) {
443446
t.Fatalf("fail to run playwright test create-backup: %v: %s: %s", err, stdout, stderr)
444447
}
445448

449+
bin := "embedded-cluster"
450+
t.Logf("%s: resetting controller node 0", time.Now().Format(time.RFC3339))
451+
stdout, stderr, err := tc.RunCommandOnNode(0, []string{bin, "reset", "--yes"})
452+
if err != nil {
453+
t.Fatalf("fail to remove controller node 0: %v: %s: %s", err, stdout, stderr)
454+
}
455+
if !strings.Contains(stdout, "High-availability is enabled and requires at least three controller-test nodes") {
456+
t.Errorf("reset output does not contain the ha warning")
457+
t.Logf("stdout: %s\nstderr: %s", stdout, stderr)
458+
}
459+
460+
stdout, stderr, err = tc.RunCommandOnNode(2, []string{"check-nodes-removed.sh", "3"})
461+
if err != nil {
462+
t.Fatalf("fail to check nodes removed: %v: %s: %s", err, stdout, stderr)
463+
}
464+
465+
t.Logf("%s: checking nllb", time.Now().Format(time.RFC3339))
466+
line = []string{"check-nllb.sh"}
467+
if stdout, stderr, err := tc.RunCommandOnNode(2, line); err != nil {
468+
t.Fatalf("fail to check nllb: %v: %s: %s", err, stdout, stderr)
469+
}
470+
446471
// reset the cluster
447472
runInParallel(t,
448473
func(t *testing.T) error {
449-
stdout, stderr, err := resetInstallationWithError(t, tc, 2, resetInstallationOptions{force: true})
474+
stdout, stderr, err := resetInstallationWithError(t, tc, 3, resetInstallationOptions{force: true})
450475
if err != nil {
451-
return fmt.Errorf("fail to reset the installation on node 2: %v: %s: %s", err, stdout, stderr)
476+
return fmt.Errorf("fail to reset the installation on node 3: %v: %s: %s", err, stdout, stderr)
452477
}
453478
return nil
454479
}, func(t *testing.T) error {
455-
stdout, stderr, err := resetInstallationWithError(t, tc, 1, resetInstallationOptions{force: true})
480+
stdout, stderr, err := resetInstallationWithError(t, tc, 2, resetInstallationOptions{force: true})
456481
if err != nil {
457-
return fmt.Errorf("fail to reset the installation on node 1: %v: %s: %s", err, stdout, stderr)
482+
return fmt.Errorf("fail to reset the installation on node 2: %v: %s: %s", err, stdout, stderr)
458483
}
459484
return nil
460485
}, func(t *testing.T) error {
461-
stdout, stderr, err := resetInstallationWithError(t, tc, 0, resetInstallationOptions{force: true})
486+
stdout, stderr, err := resetInstallationWithError(t, tc, 1, resetInstallationOptions{force: true})
462487
if err != nil {
463-
return fmt.Errorf("fail to reset the installation on node 0: %v: %s: %s", err, stdout, stderr)
488+
return fmt.Errorf("fail to reset the installation on node 1: %v: %s: %s", err, stdout, stderr)
464489
}
465490
return nil
466491
},
@@ -479,14 +504,17 @@ func TestMultiNodeHADisasterRecovery(t *testing.T) {
479504
// restore phase 1 completes when the prompt for adding nodes is reached.
480505
// add the expected nodes to the cluster, then continue to phase 2.
481506

507+
// join a worker
508+
joinWorkerNode(t, tc, 1)
509+
482510
// join a controller
483-
joinControllerNodeWithOptions(t, tc, 1, joinOptions{isRestore: true})
511+
joinControllerNodeWithOptions(t, tc, 2, joinOptions{isRestore: true})
484512

485513
// join another controller in non-HA mode
486-
joinControllerNodeWithOptions(t, tc, 2, joinOptions{isRestore: true})
514+
joinControllerNodeWithOptions(t, tc, 3, joinOptions{isRestore: true})
487515

488516
// wait for the nodes to report as ready.
489-
waitForNodes(t, tc, 3, nil, "true")
517+
waitForNodes(t, tc, 4, nil, "true")
490518

491519
t.Logf("%s: restoring the installation: phase 2", time.Now().Format(time.RFC3339))
492520
if stdout, stderr, err := tc.RunCommandOnNode(0, []string{"restore-multi-node-phase2.exp"}); err != nil {
@@ -808,13 +836,8 @@ func TestMultiNodeAirgapHADisasterRecovery(t *testing.T) {
808836
t.Fatalf("fail to run playwright test deploy-upgrade: %v: %s: %s", err, stdout, stderr)
809837
}
810838

811-
postUpgradeEnv := make(map[string]string)
812-
for k, v := range withEnv {
813-
postUpgradeEnv[k] = v
814-
}
815-
postUpgradeEnv["ALLOW_PENDING_PODS"] = "true"
816839
checkPostUpgradeStateWithOptions(t, tc, postUpgradeStateOptions{
817-
withEnv: postUpgradeEnv,
840+
withEnv: withEnv,
818841
})
819842

820843
t.Logf("%s: test complete", time.Now().Format(time.RFC3339))

0 commit comments

Comments
 (0)