Skip to content

Commit

Permalink
Fix e2e test failures and doc test failures due to updated devfile re…
Browse files Browse the repository at this point in the history
…gistry

Signed-off-by: Parthvi Vala <pvala@redhat.com>
  • Loading branch information
valaparthvi committed Apr 13, 2023
1 parent 4317255 commit 7f64af8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
$ odo registry --devfile nodejs-react
NAME REGISTRY DESCRIPTION VERSIONS
nodejs-react StagingRegistry React is a free and open-source front-en... 2.0.2, 2.1.0
nodejs-react DefaultDevfileRegistry React is a free and open-source front-en... 2.0.2
nodejs-react DefaultDevfileRegistry React is a free and open-source front-en... 2.0.2, 2.1.0
```
13 changes: 13 additions & 0 deletions tests/e2escenarios/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"path"
"path/filepath"
"regexp"
"time"

. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -47,9 +48,16 @@ var _ = Describe("E2E Test", func() {
}

Context("starting with empty Directory", func() {
var hasMultipleVersions bool
var _ = BeforeEach(func() {
helper.Chdir(commonVar.Context)
Expect(helper.ListFilesInDir(commonVar.Context)).To(BeEmpty())
out := helper.Cmd("odo", "registry", "--devfile", "nodejs", "--devfile-registry", "DefaultDevfileRegistry").ShouldPass().Out()
// Version pattern has always been in the form of X.X.X
vMatch := regexp.MustCompile(`(?:\d.\d.\d)`)
if matches := vMatch.FindAll([]byte(out), -1); len(matches) > 1 {
hasMultipleVersions = true
}
})

It("should verify developer workflow from empty Directory", func() {
Expand All @@ -67,6 +75,11 @@ var _ = Describe("E2E Test", func() {
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "Node.js")

if hasMultipleVersions {
helper.ExpectString(ctx, "Select version: ")
helper.SendLine(ctx, "")
}

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

Expand Down

0 comments on commit 7f64af8

Please sign in to comment.