Skip to content

Commit 9a603f0

Browse files
committed
Test a msg is displayed when executing odo run without odo dev
1 parent 1fdda50 commit 9a603f0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pkg/dev/common/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func Run(
3030

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

3636
handler := component.NewRunHandler(

tests/integration/cmd_run_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ var _ = Describe("odo run command tests", func() {
7070
})
7171
})
7272

73+
It("should fail if odo dev is not running", func() {
74+
output := helper.Cmd("odo", "run", "build").ShouldFail().Err()
75+
Expect(output).To(ContainSubstring(`Unable to get pod for component`))
76+
Expect(output).To(ContainSubstring(`Please check the command odo dev is running`))
77+
})
78+
7379
for _, podman := range []bool{false, true} {
7480
podman := podman
7581
When("odo dev is executed and ready", helper.LabelPodmanIf(podman, func() {

0 commit comments

Comments
 (0)