Skip to content

Commit

Permalink
Test a msg is displayed when executing odo run without odo dev
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jun 1, 2023
1 parent 1fdda50 commit 150f36d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dev/common/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Run(

pod, err := platformClient.GetPodUsingComponentName(componentName)
if err != nil {
return fmt.Errorf("unable to get pod for component %s: %w", componentName, err)
return fmt.Errorf("unable to get pod for component %s: %w. Please check the command odo dev is running", componentName, err)
}

handler := component.NewRunHandler(
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/cmd_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ var _ = Describe("odo run command tests", func() {
})
})

It("should fail if odo dev is not running", func() {
output := helper.Cmd("odo", "run", "build").ShouldFail().Err()
Expect(output).To(ContainSubstring(`unable to get pod for component`))
Expect(output).To(ContainSubstring(`Please check the command odo dev is running`))
})

for _, podman := range []bool{false, true} {
podman := podman
When("odo dev is executed and ready", helper.LabelPodmanIf(podman, func() {
Expand Down

0 comments on commit 150f36d

Please sign in to comment.