Skip to content

Commit

Permalink
Fix CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
valaparthvi committed Mar 25, 2022
1 parent 114e923 commit 10a6bb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
12 changes: 0 additions & 12 deletions tests/helper/helper_filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,6 @@ func VerifyFileExists(filename string) bool {
return !info.IsDir()
}

// VerifyFilesExist receives an array of paths to files, and returns whether
// or not they all exist. If any one of the expected files doesn't exist, it
// returns false
func VerifyFilesExist(path string, files []string) bool {
for _, f := range files {
if !VerifyFileExists(filepath.Join(path, f)) {
return false
}
}
return true
}

// ReplaceDevfileField replaces the value of a given field in a specified
// devfile.
// Currently only the first match of the field is replaced. i.e if the
Expand Down
7 changes: 3 additions & 4 deletions tests/integration/devfile/cmd_devfile_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ var _ = Describe("odo devfile init command tests", func() {

When("running odo init with a devfile that has a subDir starter project", func() {
BeforeEach(func() {
helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), commonVar.Context)
helper.Cmd("odo", "init", "--name", "aname", "--devfile-path", helper.GetExamplePath("source", "devfiles", "springboot", "devfile-with-subDir.yaml"), "--starter", "spingbootproject").ShouldPass()
helper.Cmd("odo", "init", "--name", "aname", "--devfile-path", helper.GetExamplePath("source", "devfiles", "springboot", "devfile-with-subDir.yaml"), "--starter", "springbootproject").ShouldPass()
})

It("should successfully extract the project in the specified subDir path", func() {
Expand Down Expand Up @@ -187,13 +186,13 @@ var _ = Describe("odo devfile init command tests", func() {
It("should successfully run odo init for devfile with starter project from the specified branch", func() {
helper.Cmd("odo", "init", "--name", "aname", "--devfile-path", helper.GetExamplePath("source", "devfiles", "nodejs", "devfile-with-branch.yaml"), "--starter", "nodejs-starter").ShouldPass()
expectedFiles := []string{"package.json", "package-lock.json", "README.md", "devfile.yaml", "test"}
Expect(helper.VerifyFilesExist(commonVar.Context, expectedFiles)).To(Equal(true))
Expect(helper.ListFilesInDir(commonVar.Context)).To(ContainElements(expectedFiles))
})

It("should successfully run odo init for devfile with starter project from the specified tag", func() {
helper.Cmd("odo", "init", "--name", "aname", "--devfile-path", helper.GetExamplePath("source", "devfiles", "nodejs", "devfile-with-tag.yaml"), "--starter", "nodejs-starter").ShouldPass()
expectedFiles := []string{"package.json", "package-lock.json", "README.md", "devfile.yaml", "app"}
Expect(helper.VerifyFilesExist(commonVar.Context, expectedFiles)).To(Equal(true))
Expect(helper.ListFilesInDir(commonVar.Context)).To(ContainElements(expectedFiles))
})
When("running odo init from a directory with sources", func() {
BeforeEach(func() {
Expand Down

0 comments on commit 10a6bb1

Please sign in to comment.