Skip to content

Commit

Permalink
Fix 'odo dev' tests when the run/debug does not exist
Browse files Browse the repository at this point in the history
For consistency with how e.g., the build command works,
instead of erroring out, `odo dev` will
now simply log the error message and wait for new input.
  • Loading branch information
rm3l committed Jun 12, 2023
1 parent 50afab0 commit fce1400
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/integration/cmd_dev_debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,17 @@ var _ = Describe("odo dev debug command tests", func() {
Expect(helper.VerifyFileExists(".odo/env/env.yaml")).To(BeFalse())
})

It("should fail running odo dev --debug", func() {
args := []string{"dev", "--debug"}
if podman {
args = append(args, "--platform", "podman")
}
output := helper.Cmd("odo", args...).ShouldFail().Err()
Expect(output).To(ContainSubstring("no command of kind \"debug\" found in the devfile"))
It("should log error about missing debug command when running odo dev --debug", func() {
devSession, out, _, _, err := helper.StartDevMode(helper.DevSessionOpts{
RunOnPodman: podman,
CmdlineArgs: []string{"--debug"},
})
Expect(err).ShouldNot(HaveOccurred())
defer func() {
devSession.Stop()
devSession.WaitEnd()
}()
Expect(string(out)).To(ContainSubstring("no debug command found in devfile"))
})
}))
}
Expand Down

0 comments on commit fce1400

Please sign in to comment.