Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e test failures and doc test failures due to updated devfile registry #6735

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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