Skip to content

Commit 0b6de25

Browse files
authored
Remove unnecessary e2e tests - third pass (#3155)
* Remove unnecessary config values e2e tests
1 parent 3e157e7 commit 0b6de25

File tree

3 files changed

+1
-104
lines changed

3 files changed

+1
-104
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,6 @@ jobs:
952952
test:
953953
- TestSingleNodeAirgapUpgrade
954954
- TestSingleNodeAirgapUpgradeSelinux
955-
- TestSingleNodeAirgapUpgradeConfigValues
956955
- TestMultiNodeAirgapUpgradePreviousStable
957956
- TestMultiNodeAirgapHAInstallation
958957
- TestSingleNodeAirgapDisasterRecovery

.github/workflows/release-prod.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ jobs:
566566
test:
567567
- TestSingleNodeAirgapUpgrade
568568
- TestSingleNodeAirgapUpgradeSelinux
569-
- TestSingleNodeAirgapUpgradeConfigValues
570569
- TestMultiNodeAirgapUpgradePreviousStable
571570
- TestMultiNodeAirgapHAInstallation
572571
- TestSingleNodeAirgapDisasterRecovery

e2e/install_test.go

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import (
99
"time"
1010

1111
"github.com/google/uuid"
12-
"github.com/stretchr/testify/require"
13-
1412
"github.com/replicatedhq/embedded-cluster/e2e/cluster/cmx"
1513
"github.com/replicatedhq/embedded-cluster/e2e/cluster/docker"
14+
"github.com/stretchr/testify/require"
1615
)
1716

1817
func TestSingleNodeInstallation(t *testing.T) {
@@ -972,106 +971,6 @@ spec:
972971
t.Logf("%s: test complete", time.Now().Format(time.RFC3339))
973972
}
974973

975-
func TestSingleNodeAirgapUpgradeConfigValues(t *testing.T) {
976-
t.Parallel()
977-
978-
RequireEnvVars(t, []string{"SHORT_SHA"})
979-
980-
tc := cmx.NewCluster(&cmx.ClusterInput{
981-
T: t,
982-
Nodes: 1,
983-
Distribution: "ubuntu",
984-
Version: "22.04",
985-
})
986-
defer tc.Cleanup()
987-
988-
t.Logf("%s: downloading airgap files on node 0", time.Now().Format(time.RFC3339))
989-
// Previous stable EC version with a -1 minor k0s version
990-
initialVersion := fmt.Sprintf("appver-%s-previous-stable", os.Getenv("SHORT_SHA"))
991-
runInParallel(t,
992-
func(t *testing.T) error {
993-
return downloadAirgapBundleOnNode(t, tc, 0, initialVersion, AirgapInstallBundlePath, AirgapLicenseID)
994-
}, func(t *testing.T) error {
995-
return downloadAirgapBundleOnNode(t, tc, 0, fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA")), AirgapUpgradeBundlePath, AirgapLicenseID)
996-
},
997-
)
998-
999-
t.Logf("%s: airgapping cluster", time.Now().Format(time.RFC3339))
1000-
if err := tc.Airgap(); err != nil {
1001-
t.Fatalf("failed to airgap cluster: %v", err)
1002-
}
1003-
1004-
t.Logf("%s: preparing embedded cluster airgap files", time.Now().Format(time.RFC3339))
1005-
line := []string{"airgap-prepare.sh"}
1006-
if _, _, err := tc.RunCommandOnNode(0, line); err != nil {
1007-
t.Fatalf("fail to prepare airgap files on node %s: %v", tc.Nodes[0], err)
1008-
}
1009-
1010-
hostname := uuid.New().String()
1011-
password := uuid.New().String()
1012-
1013-
// create a config values file on the node
1014-
configValuesFileContent := fmt.Sprintf(`
1015-
apiVersion: kots.io/v1beta1
1016-
kind: ConfigValues
1017-
spec:
1018-
values:
1019-
hostname:
1020-
value: %s
1021-
pw:
1022-
value: %s
1023-
`, hostname, password)
1024-
configValuesFileB64 := base64.StdEncoding.EncodeToString([]byte(configValuesFileContent))
1025-
1026-
t.Logf("%s: creating config values file", time.Now().Format(time.RFC3339))
1027-
stdout, stderr, err := tc.RunCommandOnNode(0, []string{"sh", "-c", fmt.Sprintf("'echo %s | base64 -d > /assets/config-values.yaml'", configValuesFileB64)})
1028-
if err != nil {
1029-
t.Fatalf("fail to create config values file: %v: %s: %s", err, stdout, stderr)
1030-
}
1031-
1032-
installSingleNodeWithOptions(t, tc, installOptions{
1033-
isAirgap: true,
1034-
version: initialVersion,
1035-
localArtifactMirrorPort: "50001", // choose an alternate lam port
1036-
configValuesFile: "/assets/config-values.yaml",
1037-
})
1038-
1039-
t.Logf("%s: checking installation state after app deployment", time.Now().Format(time.RFC3339))
1040-
line = []string{"check-airgap-installation-state.sh", initialVersion, k8sVersionPreviousStable()}
1041-
if _, _, err := tc.RunCommandOnNode(0, line); err != nil {
1042-
t.Fatalf("fail to check installation state: %v", err)
1043-
}
1044-
1045-
t.Logf("%s: checking config values", time.Now().Format(time.RFC3339))
1046-
line = []string{"check-config-values.sh", hostname, password}
1047-
if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil {
1048-
t.Fatalf("fail to check config values: %v: %s: %s", err, stdout, stderr)
1049-
}
1050-
1051-
line = []string{"airgap-update.sh"}
1052-
if _, _, err := tc.RunCommandOnNode(0, line); err != nil {
1053-
t.Fatalf("fail to run airgap update: %v", err)
1054-
}
1055-
1056-
appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA"))
1057-
testArgs := []string{appUpgradeVersion, "", hostname}
1058-
1059-
t.Logf("%s: upgrading cluster", time.Now().Format(time.RFC3339))
1060-
if stdout, stderr, err := tc.SetupPlaywrightAndRunTest("deploy-upgrade", testArgs...); err != nil {
1061-
t.Fatalf("fail to run playwright test deploy-upgrade: %v: %s: %s", err, stdout, stderr)
1062-
}
1063-
1064-
checkPostUpgradeState(t, tc)
1065-
1066-
t.Logf("%s: checking config values after upgrade", time.Now().Format(time.RFC3339))
1067-
line = []string{"check-config-values.sh", "updated-hostname.com", "updated password"}
1068-
if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil {
1069-
t.Fatalf("fail to check config values: %v: %s: %s", err, stdout, stderr)
1070-
}
1071-
1072-
t.Logf("%s: test complete", time.Now().Format(time.RFC3339))
1073-
}
1074-
1075974
//Temporarily disable network test until the reporting is enriched to the point where we can properly filter out domains as part of a CNAME chain
1076975
/*func TestSingleNodeNetworkReport(t *testing.T) {
1077976
t.Parallel()

0 commit comments

Comments
 (0)