@@ -70,6 +70,12 @@ var _ = Describe("odo run command tests", func() {
70
70
})
71
71
})
72
72
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
+
73
79
for _ , podman := range []bool {false , true } {
74
80
podman := podman
75
81
When ("odo dev is executed and ready" , helper .LabelPodmanIf (podman , func () {
@@ -112,12 +118,21 @@ var _ = Describe("odo run command tests", func() {
112
118
})
113
119
}
114
120
115
- By ("executing apply command on Image component" , func () {
116
- // Will fail because Dockerfile is not present, but we just want to check the build is started
117
- // We cannot use PODMAN_CMD=echo with --platform=podman
118
- output := helper .Cmd ("odo" , "run" , "build-image" , "--platform" , platform ).ShouldFail ().Out ()
119
- Expect (output ).To (ContainSubstring ("Building image locally" ))
120
- })
121
+ if podman {
122
+ By ("executing apply command on Image component" , func () {
123
+ // Will fail because Dockerfile is not present, but we just want to check the build is started
124
+ // We cannot use PODMAN_CMD=echo with --platform=podman
125
+ output := helper .Cmd ("odo" , "run" , "build-image" , "--platform" , platform ).ShouldFail ().Out ()
126
+ Expect (output ).To (ContainSubstring ("Building image locally" ))
127
+ })
128
+ } else {
129
+ By ("executing apply command on Image component" , func () {
130
+ output := helper .Cmd ("odo" , "run" , "build-image" , "--platform" , platform ).AddEnv ("PODMAN_CMD=echo" ).ShouldPass ().Out ()
131
+ Expect (output ).To (ContainSubstring ("Building image locally" ))
132
+ Expect (output ).To (ContainSubstring ("Pushing image to container registry" ))
133
+
134
+ })
135
+ }
121
136
})
122
137
}))
123
138
}
0 commit comments