diff --git a/src/test/external/common.go b/src/test/external/common.go index 6bdcf4174c..2e9cd8bb68 100644 --- a/src/test/external/common.go +++ b/src/test/external/common.go @@ -20,10 +20,6 @@ import ( var zarfBinPath = path.Join("../../../build", test.GetCLIName()) -func verifyKubectlWaitSuccess(t *testing.T, timeoutMinutes time.Duration, args []string, onTimeout string) bool { - return verifyWaitSuccess(t, timeoutMinutes, "kubectl", args, "condition met", onTimeout) -} - func createPodInfoPackageWithInsecureSources(t *testing.T, temp string) { err := copy.Copy("../../../examples/podinfo-flux", temp) require.NoError(t, err) diff --git a/src/test/external/ext_in_cluster_test.go b/src/test/external/ext_in_cluster_test.go index 8c4c0a12bc..655cb7c59a 100644 --- a/src/test/external/ext_in_cluster_test.go +++ b/src/test/external/ext_in_cluster_test.go @@ -154,23 +154,38 @@ func (suite *ExtInClusterTestSuite) Test_1_Deploy() { err = exec.CmdWithPrint(zarfBinPath, deployArgs...) suite.NoError(err, "unable to deploy flux example package") - // Verify flux was able to pull from the 'external' git repository - podinfoWaitCmd := []string{"wait", "deployment", "-n=podinfo-git", "podinfo", "--for", "condition=Available=True", "--timeout=3s"} - errorStr := "unable to verify flux (git) deployed the podinfo example" - success := verifyKubectlWaitSuccess(suite.T(), 2, podinfoWaitCmd, errorStr) - suite.True(success, errorStr) - - // Verify flux was able to pull from the 'external' helm repository - podinfoWaitCmd = []string{"wait", "deployment", "-n=podinfo-helm", "podinfo", "--for", "condition=Available=True", "--timeout=3s"} - errorStr = "unable to verify flux (helm) deployed the podinfo example" - success = verifyKubectlWaitSuccess(suite.T(), 2, podinfoWaitCmd, errorStr) - suite.True(success, errorStr) - - // Verify flux was able to pull from the 'external' oci repository - podinfoWaitCmd = []string{"wait", "deployment", "-n=podinfo-oci", "podinfo", "--for", "condition=Available=True", "--timeout=3s"} - errorStr = "unable to verify flux (oci) deployed the podinfo example" - success = verifyKubectlWaitSuccess(suite.T(), 2, podinfoWaitCmd, errorStr) - suite.True(success, errorStr) + c, err := cluster.NewCluster() + suite.NoError(err) + objs := []object.ObjMetadata{ + { + GroupKind: schema.GroupKind{ + Group: "apps", + Kind: "Deployment", + }, + Namespace: "podinfo-git", + Name: "podinfo", + }, + { + GroupKind: schema.GroupKind{ + Group: "apps", + Kind: "Deployment", + }, + Namespace: "podinfo-helm", + Name: "podinfo", + }, + { + GroupKind: schema.GroupKind{ + Group: "apps", + Kind: "Deployment", + }, + Namespace: "podinfo-oci", + Name: "podinfo", + }, + } + waitCtx, waitCancel := context.WithTimeout(context.Background(), 60*time.Second) + defer waitCancel() + err = pkgkubernetes.WaitForReady(waitCtx, c.Watcher, objs) + suite.NoError(err) _, _, err = exec.CmdWithContext(context.TODO(), exec.PrintCfg(), zarfBinPath, "destroy", "--confirm") suite.NoError(err, "unable to teardown zarf")