forked from weaveworks/weave-gitops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add wego-uninstall & app-config=none tests (weaveworks#413)
* add wego-uninstall & app-config=none tests * fix lint issues * run tests on ci * run install tests on ci * remove smoke tags * change test placement
- Loading branch information
1 parent
79722a5
commit ca78d97
Showing
3 changed files
with
85 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,7 +309,7 @@ var _ = Describe("Weave GitOps Add Tests", func() { | |
defaultSshKeyPath := os.Getenv("HOME") + "/.ssh/id_rsa" | ||
appRepoName := "wego-test-app-" + RandString(8) | ||
url := "ssh://[email protected]/" + os.Getenv("GITHUB_ORG") + "/" + appRepoName + ".git" | ||
addCommand := "app add . --url=" + url + " --branch=" + branchName + " --dry-run" | ||
addCommand := "app add --url=" + url + " --branch=" + branchName + " --dry-run" | ||
appName := appRepoName | ||
appType := "Kustomization" | ||
|
||
|
@@ -365,7 +365,7 @@ var _ = Describe("Weave GitOps Add Tests", func() { | |
}) | ||
|
||
// Eventually this test run will include all the remaining un-automated `wego app add` flags. | ||
It("Verify 'wego app add' works with user-specified branch, namespace", func() { | ||
It("Verify 'wego app add' works with user-specified branch, namespace, url", func() { | ||
var repoAbsolutePath string | ||
private := true | ||
appRepoName := "wego-test-app-" + RandString(8) | ||
|
@@ -376,7 +376,8 @@ var _ = Describe("Weave GitOps Add Tests", func() { | |
workloadNamespace := "my-nginx-" + uniqueSuffix | ||
defaultSshKeyPath := os.Getenv("HOME") + "/.ssh/id_rsa" | ||
wegoNamespace := "my-space" | ||
addCommand := "app add . --branch=" + branchName + " --namespace=" + wegoNamespace | ||
url := "ssh://[email protected]/" + os.Getenv("GITHUB_ORG") + "/" + appRepoName + ".git" | ||
addCommand := "app add --url=" + url + " --branch=" + branchName + " --namespace=" + wegoNamespace | ||
appName := appRepoName | ||
|
||
defer deleteRepo(appRepoName) | ||
|
@@ -412,7 +413,7 @@ var _ = Describe("Weave GitOps Add Tests", func() { | |
createGitRepoBranch(repoAbsolutePath, branchName) | ||
}) | ||
|
||
By("And I run wego add command with specified branch", func() { | ||
By("And I run wego add command with specified branch, namespace, url", func() { | ||
runWegoAddCommand(repoAbsolutePath, addCommand, wegoNamespace) | ||
}) | ||
|
||
|
@@ -827,4 +828,57 @@ var _ = Describe("Weave GitOps Add Tests", func() { | |
verifyWorkloadIsDeployed(workloadName2, workloadNamespace2) | ||
}) | ||
}) | ||
|
||
It("Verify wego can add kustomize-based app with 'app-config-url=NONE'", func() { | ||
var repoAbsolutePath string | ||
private := true | ||
appRepoName := "wego-test-app-" + RandString(8) | ||
uniqueSuffix := RandString(6) | ||
appManifestFilePath := getUniqueWorkload("xxyyzz", uniqueSuffix) | ||
workloadName := "nginx-" + uniqueSuffix | ||
workloadNamespace := "my-nginx-" + uniqueSuffix | ||
defaultSshKeyPath := "~/.ssh/id_rsa" | ||
addCommand := "app add . --app-config-url=NONE" | ||
appName := appRepoName | ||
|
||
defer deleteRepo(appRepoName) | ||
defer deleteWorkload(workloadName, workloadNamespace) | ||
|
||
By("And application repo does not already exist", func() { | ||
deleteRepo(appRepoName) | ||
}) | ||
|
||
By("And application workload is not already deployed to cluster", func() { | ||
deleteWorkload(workloadName, workloadNamespace) | ||
}) | ||
|
||
By("When I create a private repo with my app workload", func() { | ||
repoAbsolutePath = initAndCreateEmptyRepo(appRepoName, private) | ||
gitAddCommitPush(repoAbsolutePath, appManifestFilePath) | ||
}) | ||
|
||
By("And I install wego under my namespace: "+WEGO_DEFAULT_NAMESPACE, func() { | ||
installAndVerifyWego(WEGO_DEFAULT_NAMESPACE) | ||
}) | ||
|
||
By("And I have my default ssh key on path "+defaultSshKeyPath, func() { | ||
setupSSHKey(defaultSshKeyPath) | ||
}) | ||
|
||
By("And I run wego add command with app-config-url set to 'none'", func() { | ||
runWegoAddCommand(repoAbsolutePath, addCommand, WEGO_DEFAULT_NAMESPACE) | ||
}) | ||
|
||
By("Then I should see my workload deployed to the cluster", func() { | ||
verifyWegoAddCommand(appName, WEGO_DEFAULT_NAMESPACE) | ||
verifyWorkloadIsDeployed(workloadName, workloadNamespace) | ||
}) | ||
|
||
By("And I should not see wego components in the remote git repo", func() { | ||
folderOutput, _ := runCommandAndReturnOutput(fmt.Sprintf("cd %s && ls -al", repoAbsolutePath)) | ||
Eventually(folderOutput).ShouldNot(ContainSubstring(".wego")) | ||
Eventually(folderOutput).ShouldNot(ContainSubstring("apps")) | ||
Eventually(folderOutput).ShouldNot(ContainSubstring("targets")) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters