Skip to content

Commit

Permalink
add temp focus and debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake committed Feb 9, 2022
1 parent fbdeffd commit bc4d4ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/acceptance/test/profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var _ = Describe("Weave GitOps Profiles API", func() {
deleteNamespace(namespace)
})

It("gets deployed and is accessible via the service", func() {
FIt("gets deployed and is accessible via the service", func() {
By("Installing the Profiles API and setting up the profile helm repository")
appRepoRemoteURL = "git@github.com:" + githubOrg + "/" + tip.appRepoName + ".git"
installAndVerifyWego(namespace, appRepoRemoteURL)
Expand Down
14 changes: 12 additions & 2 deletions test/acceptance/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,17 +341,27 @@ func getGitRepoVisibility(org string, repo string, providerName gitproviders.Git

//Assumes resource will eventually contain a status.Conditions where Type=Ready exists
func waitForResourceToBeReady(resourceType string, resourceName string, namespace string, timeout time.Duration) {
var getResourceOutput []byte

EventuallyWithOffset(1, func() error {
kubectlCommand := fmt.Sprintf(`kubectl get pods -n wego-system -o jsonpath="{.items[*].spec.containers[*].image}"`)
var err error
if getResourceOutput, err = exec.Command("sh", "-c", kubectlCommand).CombinedOutput(); err != nil {
return err
}

fmt.Printf("images: %s\n", string(getResourceOutput))

log.Infof("Waiting for %s/%s in namespace: %q to be ready : ", resourceType, resourceName, namespace)
kubectlCommand := fmt.Sprintf("kubectl -n %s wait --for=condition=ready %s %s", namespace, resourceType, resourceName)
kubectlCommand = fmt.Sprintf("kubectl -n %s wait --for=condition=ready %s %s", namespace, resourceType, resourceName)
if resourceName == "" {
kubectlCommand = kubectlCommand + " --all"
}
if _, err := exec.Command("sh", "-c", kubectlCommand).CombinedOutput(); err != nil {
return err
}
return nil
}, timeout, "5s").Should(Succeed(), fmt.Sprintf("Failed to find the resource %s of type %s, timeout reached", resourceName, resourceType))
}, timeout, "5s").Should(Succeed(), fmt.Sprintf("Failed to find the resource %s of type %s, timeout reached. Last seen resources: %s", resourceName, resourceType, string(getResourceOutput)))
}

func waitForResourceToExist(resourceType string, resourceName string, namespace string, timeout time.Duration) {
Expand Down

0 comments on commit bc4d4ac

Please sign in to comment.