diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b77cc86c1c..ad9ea6d447 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: args: - "--allow-missing-credentials" - id: detect-private-key - exclude: "src/test/e2e/30_config_file_test.go" + exclude: "src/test/e2e/29_config_file_test.go" - id: end-of-file-fixer exclude: site/src/content/docs/commands/.* - id: fix-byte-order-marker diff --git a/src/test/common.go b/src/test/common.go index 4eb9844045..70492f014c 100644 --- a/src/test/common.go +++ b/src/test/common.go @@ -27,7 +27,6 @@ type ZarfE2ETest struct { Arch string ApplianceMode bool ApplianceModeKeep bool - RunClusterTests bool } var logRegex = regexp.MustCompile(`Saving log file to (?P.*?\.log)`) @@ -53,14 +52,6 @@ func GetCLIName() string { return binaryName } -// SetupWithCluster performs actions for each test that requires a K8s cluster. -func (e2e *ZarfE2ETest) SetupWithCluster(t *testing.T) { - if !e2e.RunClusterTests { - t.Skip("") - } - _ = exec.CmdWithPrint("sh", "-c", fmt.Sprintf("%s tools kubectl describe nodes | grep -A 99 Non-terminated", e2e.ZarfBinPath)) -} - // Zarf executes a Zarf command. func (e2e *ZarfE2ETest) Zarf(args ...string) (string, string, error) { if !slices.Contains(args, "--tmpdir") && !slices.Contains(args, "tools") { diff --git a/src/test/e2e/20_zarf_init_test.go b/src/test/e2e/20_zarf_init_test.go index 92fe26bc98..f54fc54f85 100644 --- a/src/test/e2e/20_zarf_init_test.go +++ b/src/test/e2e/20_zarf_init_test.go @@ -18,7 +18,6 @@ import ( func TestZarfInit(t *testing.T) { t.Log("E2E: Zarf init") - e2e.SetupWithCluster(t) initComponents := "git-server" if e2e.ApplianceMode { diff --git a/src/test/e2e/21_connect_creds_test.go b/src/test/e2e/21_connect_creds_test.go index 5c68277ff7..3a929ac596 100644 --- a/src/test/e2e/21_connect_creds_test.go +++ b/src/test/e2e/21_connect_creds_test.go @@ -23,7 +23,6 @@ type RegistryResponse struct { func TestConnectAndCreds(t *testing.T) { t.Log("E2E: Connect") - e2e.SetupWithCluster(t) prevAgentSecretData, _, err := e2e.Kubectl("get", "secret", "agent-hook-tls", "-n", "zarf", "-o", "jsonpath={.data}") require.NoError(t, err) @@ -44,7 +43,6 @@ func TestConnectAndCreds(t *testing.T) { func TestMetrics(t *testing.T) { t.Log("E2E: Emits metrics") - e2e.SetupWithCluster(t) c, err := cluster.NewCluster() require.NoError(t, err) diff --git a/src/test/e2e/22_git_and_gitops_test.go b/src/test/e2e/22_git_and_gitops_test.go index 8b53bacfaf..956ded5ed9 100644 --- a/src/test/e2e/22_git_and_gitops_test.go +++ b/src/test/e2e/22_git_and_gitops_test.go @@ -21,7 +21,6 @@ import ( func TestGit(t *testing.T) { t.Log("E2E: Git") - e2e.SetupWithCluster(t) buildPath := filepath.Join("src", "test", "packages", "22-git-data") stdOut, stdErr, err := e2e.Zarf("package", "create", buildPath, "-o=build", "--confirm") @@ -48,14 +47,12 @@ func TestGit(t *testing.T) { func TestGitOpsFlux(t *testing.T) { t.Log("E2E: GitOps / Flux") - e2e.SetupWithCluster(t) waitFluxPodInfoDeployment(t) } func TestGitOpsArgoCD(t *testing.T) { t.Log("E2E: ArgoCD / Flux") - e2e.SetupWithCluster(t) waitArgoDeployment(t) } diff --git a/src/test/e2e/23_data_injection_test.go b/src/test/e2e/23_data_injection_test.go index efbce9bc13..9e4bbef7c3 100644 --- a/src/test/e2e/23_data_injection_test.go +++ b/src/test/e2e/23_data_injection_test.go @@ -19,7 +19,6 @@ import ( func TestDataInjection(t *testing.T) { t.Log("E2E: Data injection") - e2e.SetupWithCluster(t) ctx := context.Background() diff --git a/src/test/e2e/24_variables_test.go b/src/test/e2e/24_variables_test.go index c0f546ad83..765c8902bf 100644 --- a/src/test/e2e/24_variables_test.go +++ b/src/test/e2e/24_variables_test.go @@ -15,7 +15,6 @@ import ( func TestVariables(t *testing.T) { t.Log("E2E: Package variables") - e2e.SetupWithCluster(t) evilSrc := filepath.Join("src", "test", "packages", "24-evil-variables") evilPath := fmt.Sprintf("zarf-package-evil-variables-%s.tar.zst", e2e.Arch) diff --git a/src/test/e2e/25_helm_test.go b/src/test/e2e/25_helm_test.go index 7c643288c0..280ba3d7ec 100644 --- a/src/test/e2e/25_helm_test.go +++ b/src/test/e2e/25_helm_test.go @@ -17,7 +17,6 @@ var helmChartsPkg string func TestHelm(t *testing.T) { t.Log("E2E: Helm chart") - e2e.SetupWithCluster(t) helmChartsPkg = filepath.Join("build", fmt.Sprintf("zarf-package-helm-charts-%s-0.0.1.tar.zst", e2e.Arch)) diff --git a/src/test/e2e/26_simple_packages_test.go b/src/test/e2e/26_simple_packages_test.go index 347aad89fd..97a67423e3 100644 --- a/src/test/e2e/26_simple_packages_test.go +++ b/src/test/e2e/26_simple_packages_test.go @@ -17,7 +17,6 @@ import ( func TestDosGames(t *testing.T) { t.Log("E2E: Dos games") - e2e.SetupWithCluster(t) path := filepath.Join("build", fmt.Sprintf("zarf-package-dos-games-%s-1.0.0.tar.zst", e2e.Arch)) @@ -53,7 +52,6 @@ func TestDosGames(t *testing.T) { func TestManifests(t *testing.T) { t.Log("E2E: Local, Remote, and Kustomize Manifests") - e2e.SetupWithCluster(t) path := filepath.Join("build", fmt.Sprintf("zarf-package-manifests-%s-0.0.1.tar.zst", e2e.Arch)) @@ -68,7 +66,6 @@ func TestManifests(t *testing.T) { func TestAgentIgnore(t *testing.T) { t.Log("E2E: Test Manifests that are Agent Ignored") - e2e.SetupWithCluster(t) testCreate := filepath.Join("src", "test", "packages", "26-agent-ignore") testDeploy := filepath.Join("build", fmt.Sprintf("zarf-package-agent-ignore-namespace-%s.tar.zst", e2e.Arch)) diff --git a/src/test/e2e/27_deploy_regression_test.go b/src/test/e2e/27_deploy_regression_test.go index 0f70365a63..fec8d55433 100644 --- a/src/test/e2e/27_deploy_regression_test.go +++ b/src/test/e2e/27_deploy_regression_test.go @@ -15,7 +15,6 @@ import ( func TestGHCRDeploy(t *testing.T) { t.Log("E2E: GHCR OCI deploy") - e2e.SetupWithCluster(t) var sha string // shas for package published 2023-08-08T22:13:51Z @@ -36,7 +35,6 @@ func TestGHCRDeploy(t *testing.T) { func TestCosignDeploy(t *testing.T) { t.Log("E2E: Cosign deploy") - e2e.SetupWithCluster(t) // Test with command from https://docs.zarf.dev/getting-started/install/ command := fmt.Sprintf("%s package deploy sget://defenseunicorns/zarf-hello-world:$(uname -m) --confirm", e2e.ZarfBinPath) diff --git a/src/test/e2e/28_wait_test.go b/src/test/e2e/28_wait_test.go index 16d2ddff4f..0de68f243e 100644 --- a/src/test/e2e/28_wait_test.go +++ b/src/test/e2e/28_wait_test.go @@ -27,7 +27,6 @@ func zarfCommandWStruct(e2e test.ZarfE2ETest, path string) (result zarfCommandRe func TestNoWait(t *testing.T) { t.Log("E2E: Helm Wait") - e2e.SetupWithCluster(t) stdOut, stdErr, err := e2e.Zarf("package", "create", "src/test/packages/28-helm-no-wait", "-o=build", "--confirm") require.NoError(t, err, stdOut, stdErr) diff --git a/src/test/e2e/29_config_file_test.go b/src/test/e2e/29_config_file_test.go index 5095efa91f..40c66b4204 100644 --- a/src/test/e2e/29_config_file_test.go +++ b/src/test/e2e/29_config_file_test.go @@ -15,7 +15,6 @@ import ( func TestConfigFile(t *testing.T) { t.Log("E2E: Config file") - e2e.SetupWithCluster(t) var ( path = fmt.Sprintf("zarf-package-config-file-%s.tar.zst", e2e.Arch) diff --git a/src/test/e2e/30_component_action_cluster_test.go b/src/test/e2e/30_component_action_cluster_test.go index 47efd3a6a4..5d6658152f 100644 --- a/src/test/e2e/30_component_action_cluster_test.go +++ b/src/test/e2e/30_component_action_cluster_test.go @@ -14,7 +14,6 @@ import ( func TestComponentActionRemove(t *testing.T) { t.Log("E2E: Component action remove") - e2e.SetupWithCluster(t) packagePath := filepath.Join("build", fmt.Sprintf("zarf-package-component-actions-%s.tar.zst", e2e.Arch)) @@ -31,7 +30,6 @@ func TestComponentActionRemove(t *testing.T) { func TestComponentActionEdgeCases(t *testing.T) { t.Log("E2E: Component action edge cases") - e2e.SetupWithCluster(t) sourcePath := filepath.Join("src", "test", "packages", "31-component-actions-edgecases") packagePath := fmt.Sprintf("zarf-package-component-actions-edgecases-%s.tar.zst", e2e.Arch) diff --git a/src/test/e2e/31_checksum_and_signature_test.go b/src/test/e2e/31_checksum_and_signature_test.go index 957deaeaa8..2b3856779f 100644 --- a/src/test/e2e/31_checksum_and_signature_test.go +++ b/src/test/e2e/31_checksum_and_signature_test.go @@ -13,7 +13,6 @@ import ( func TestChecksumAndSignature(t *testing.T) { t.Log("E2E: Checksum and Signature") - e2e.SetupWithCluster(t) testPackageDirPath := "examples/dos-games" pkgName := fmt.Sprintf("zarf-package-dos-games-%s-1.0.0.tar.zst", e2e.Arch) diff --git a/src/test/e2e/32_component_webhooks_test.go b/src/test/e2e/32_component_webhooks_test.go index cbb8321b08..d409e62521 100644 --- a/src/test/e2e/32_component_webhooks_test.go +++ b/src/test/e2e/32_component_webhooks_test.go @@ -13,7 +13,6 @@ import ( func TestComponentWebhooks(t *testing.T) { t.Log("E2E: Component Webhooks") - e2e.SetupWithCluster(t) // Deploy example Pepr webhook. webhookPath := fmt.Sprintf("build/zarf-package-component-webhooks-%s-0.0.1.tar.zst", e2e.Arch) diff --git a/src/test/e2e/34_custom_init_package_test.go b/src/test/e2e/34_custom_init_package_test.go index aae69e30e9..6229255aca 100644 --- a/src/test/e2e/34_custom_init_package_test.go +++ b/src/test/e2e/34_custom_init_package_test.go @@ -14,7 +14,7 @@ import ( func TestCustomInit(t *testing.T) { t.Log("E2E: Custom Init Package") - e2e.SetupWithCluster(t) + buildPath := filepath.Join("src", "test", "packages", "35-custom-init-package") pkgName := fmt.Sprintf("zarf-init-%s-%s.tar.zst", e2e.Arch, e2e.GetZarfVersion(t)) privateKeyFlag := "--signing-key=src/test/packages/zarf-test.prv-key" diff --git a/src/test/e2e/35_custom_retries_test.go b/src/test/e2e/35_custom_retries_test.go index cbe5428a25..92d7e2fffe 100644 --- a/src/test/e2e/35_custom_retries_test.go +++ b/src/test/e2e/35_custom_retries_test.go @@ -15,7 +15,6 @@ import ( func TestRetries(t *testing.T) { t.Log("E2E: Custom Retries") - e2e.SetupWithCluster(t) tmpDir := t.TempDir() diff --git a/src/test/e2e/50_oci_publish_deploy_test.go b/src/test/e2e/50_oci_publish_deploy_test.go index 96f0d6c7f1..f3d5d89428 100644 --- a/src/test/e2e/50_oci_publish_deploy_test.go +++ b/src/test/e2e/50_oci_publish_deploy_test.go @@ -164,7 +164,6 @@ func (suite *PublishDeploySuiteTestSuite) Test_3_Copy() { } func TestPublishDeploySuite(t *testing.T) { - e2e.SetupWithCluster(t) suite.Run(t, new(PublishDeploySuiteTestSuite)) } diff --git a/src/test/e2e/51_oci_compose_test.go b/src/test/e2e/51_oci_compose_test.go index c59d7477c1..124dbb953a 100644 --- a/src/test/e2e/51_oci_compose_test.go +++ b/src/test/e2e/51_oci_compose_test.go @@ -284,7 +284,6 @@ func (suite *SkeletonSuite) verifyComponentPaths(unpackedPath string, components } func TestSkeletonSuite(t *testing.T) { - e2e.SetupWithCluster(t) suite.Run(t, new(SkeletonSuite)) } diff --git a/src/test/e2e/99_appliance_remove_test.go b/src/test/e2e/99_appliance_remove_test.go index 1e34af99e0..321f353228 100644 --- a/src/test/e2e/99_appliance_remove_test.go +++ b/src/test/e2e/99_appliance_remove_test.go @@ -19,8 +19,6 @@ func TestApplianceRemove(t *testing.T) { return } - e2e.SetupWithCluster(t) - initPackageVersion := e2e.GetZarfVersion(t) path := fmt.Sprintf("build/zarf-init-%s-%s.tar.zst", e2e.Arch, initPackageVersion) diff --git a/src/test/e2e/99_yolo_test.go b/src/test/e2e/99_yolo_test.go index bce9ab1450..01671b8600 100644 --- a/src/test/e2e/99_yolo_test.go +++ b/src/test/e2e/99_yolo_test.go @@ -22,8 +22,6 @@ func TestYOLOMode(t *testing.T) { return } - e2e.SetupWithCluster(t) - // Destroy the cluster to test Zarf cleaning up after itself stdOut, stdErr, err := e2e.Zarf("destroy", "--confirm", "--remove-components") require.NoError(t, err, stdOut, stdErr) @@ -54,7 +52,6 @@ func TestDevDeploy(t *testing.T) { if e2e.ApplianceMode { return } - e2e.SetupWithCluster(t) stdOut, stdErr, err := e2e.Zarf("dev", "deploy", "examples/dos-games") require.NoError(t, err, stdOut, stdErr) diff --git a/src/test/e2e/main_test.go b/src/test/e2e/main_test.go index 9670335641..6c9c283a55 100644 --- a/src/test/e2e/main_test.go +++ b/src/test/e2e/main_test.go @@ -38,7 +38,6 @@ func TestMain(m *testing.M) { e2e.ZarfBinPath = filepath.Join("build", test.GetCLIName()) e2e.ApplianceMode = os.Getenv(applianceModeEnvVar) == "true" e2e.ApplianceModeKeep = os.Getenv(applianceModeKeepEnvVar) == "true" - e2e.RunClusterTests = true message.SetLogLevel(message.TraceLevel) diff --git a/src/test/nightly/ecr_publish_test.go b/src/test/nightly/ecr_publish_test.go index a1d07e73e1..8d696660c8 100644 --- a/src/test/nightly/ecr_publish_test.go +++ b/src/test/nightly/ecr_publish_test.go @@ -39,8 +39,6 @@ func TestECRPublishing(t *testing.T) { // Set up the e2e configs e2e.Arch = config.GetArch() e2e.ZarfBinPath = path.Join("build", test.GetCLIName()) - e2e.ApplianceMode = true - e2e.RunClusterTests = false // Set up variables for common names/locations testPackageName := "helm-charts"