List namespace right after namespace has been created (#6922)

* List namespace right after namespace has been created

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add sleep after listing namespaces

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Error out when timeout is reached

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Modify spinner messages

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Attempt at fixing doc tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

---------

Signed-off-by: Parthvi Vala <pvala@redhat.com>
This commit is contained in:
Parthvi Vala
2023-06-27 19:32:54 +05:30
committed by GitHub
parent 324d73fb37
commit 3bf5ffc369
7 changed files with 58 additions and 17 deletions

View File

@@ -41,7 +41,9 @@ func StripSpinner(docString string) (returnString string) {
if (strings.HasPrefix(line, "• Downloading") ||
strings.HasPrefix(line, "• Syncing") ||
strings.HasPrefix(line, "• Building") ||
strings.HasPrefix(line, "• Waiting for the application")) &&
strings.HasPrefix(line, "• Waiting for the application") ||
strings.HasPrefix(line, "• Creating the namespace") ||
strings.HasPrefix(line, "• Creating the project")) &&
strings.HasSuffix(line, "...") {
continue
}

View File

@@ -25,6 +25,20 @@ var _ = Describe("odo create/delete/list/set namespace/project tests", func() {
AfterEach(func() {
helper.CommonAfterEach(commonVar)
})
When("namespace is created with -w", func() {
// Ref: https://github.com/redhat-developer/odo/issues/6827
var namespace string
BeforeEach(func() {
namespace = helper.GetProjectName()
helper.Cmd("odo", "create", "namespace", namespace, "--wait").ShouldPass()
})
It("should list the new namespace when listing namespace", func() {
out := helper.Cmd("odo", "list", "namespace").ShouldPass().Out()
Expect(out).To(ContainSubstring(namespace))
})
})
for _, commandName := range []string{"namespace", "project"} {
// this is a workaround to ensure that the for loop works with `It` blocks
commandName := commandName