Skip to content

Commit

Permalink
Fix `should print warning about default namespace when running odo de…
Browse files Browse the repository at this point in the history
…v` test when Dev Session does not start correctly (#6848)

The goal of this test is to ensure that the warning message is displayed,
so it does not matter if the Dev Session does not start correctly.
  • Loading branch information
rm3l authored May 26, 2023
1 parent e9077be commit 511aaa2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/integration/cmd_dev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,15 @@ echo "$@"
if helper.IsKubernetesCluster() {
namespace = "namespace"
}
err := helper.RunDevMode(helper.DevSessionOpts{}, func(session *gexec.Session, outContents []byte, errContents []byte, ports map[string]string) {
Expect(string(errContents)).To(ContainSubstring(fmt.Sprintf("You are using \"default\" %[1]s, odo may not work as expected in the default %[1]s.", namespace)))
})
Expect(err).ToNot(HaveOccurred())
// Resources might not pass the security requirements on the default namespace on certain clusters (case of OpenShift 4.14),
// but this is not important here, as we just want to make sure that the warning message is displayed (even if the Dev Session does not start correctly).
devSession, _, stderr, err := helper.WaitForDevModeToContain(helper.DevSessionOpts{}, "Running on the cluster in Dev mode", false, false)
Expect(err).ShouldNot(HaveOccurred())
defer func() {
devSession.Stop()
devSession.WaitEnd()
}()
Expect(string(stderr)).To(ContainSubstring(fmt.Sprintf("You are using \"default\" %[1]s, odo may not work as expected in the default %[1]s.", namespace)))
})
})

Expand Down

0 comments on commit 511aaa2

Please sign in to comment.