Skip to content

Commit 511aaa2

Browse files
authored
Fix should print warning about default namespace when running odo dev 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.
1 parent e9077be commit 511aaa2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/integration/cmd_dev_test.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,15 @@ echo "$@"
136136
if helper.IsKubernetesCluster() {
137137
namespace = "namespace"
138138
}
139-
err := helper.RunDevMode(helper.DevSessionOpts{}, func(session *gexec.Session, outContents []byte, errContents []byte, ports map[string]string) {
140-
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)))
141-
})
142-
Expect(err).ToNot(HaveOccurred())
139+
// Resources might not pass the security requirements on the default namespace on certain clusters (case of OpenShift 4.14),
140+
// 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).
141+
devSession, _, stderr, err := helper.WaitForDevModeToContain(helper.DevSessionOpts{}, "Running on the cluster in Dev mode", false, false)
142+
Expect(err).ShouldNot(HaveOccurred())
143+
defer func() {
144+
devSession.Stop()
145+
devSession.WaitEnd()
146+
}()
147+
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)))
143148
})
144149
})
145150

0 commit comments

Comments
 (0)