@@ -89,15 +89,35 @@ var _ = Describe("odo run command tests", func() {
89
89
devSession .WaitEnd ()
90
90
})
91
91
92
- It ("should execute a command " , func () {
92
+ It ("should execute commands " , func () {
93
93
platform := "cluster"
94
94
if podman {
95
95
platform = "podman"
96
96
}
97
- output := helper .Cmd ("odo" , "run" , "create-file" , "--platform" , platform ).ShouldPass ().Out ()
98
- Expect (output ).To (ContainSubstring ("Executing command in container (command: create-file)" ))
99
- component := helper .NewComponent (cmpName , "app" , labels .ComponentDevMode , commonVar .Project , commonVar .CliRunner )
100
- component .Exec ("runtime" , []string {"ls" , "/tmp/new-file" }, pointer .Bool (true ))
97
+
98
+ By ("executing an exec command" , func () {
99
+ output := helper .Cmd ("odo" , "run" , "create-file" , "--platform" , platform ).ShouldPass ().Out ()
100
+ Expect (output ).To (ContainSubstring ("Executing command in container (command: create-file)" ))
101
+ component := helper .NewComponent (cmpName , "app" , labels .ComponentDevMode , commonVar .Project , commonVar .CliRunner )
102
+ component .Exec ("runtime" , []string {"ls" , "/tmp/new-file" }, pointer .Bool (true ))
103
+ })
104
+
105
+ if ! podman {
106
+ By ("executing apply command on Kubernetes component" , func () {
107
+ output := helper .Cmd ("odo" , "run" , "deploy-config" , "--platform" , platform ).ShouldPass ().Out ()
108
+ Expect (output ).To (ContainSubstring ("Creating resource ConfigMap/my-config" ))
109
+ out := commonVar .CliRunner .Run ("get" , "configmap" , "my-config" , "-n" ,
110
+ commonVar .Project ).Wait ().Out .Contents ()
111
+ Expect (out ).To (ContainSubstring ("my-config" ))
112
+ })
113
+ }
114
+
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
+ })
101
121
})
102
122
}))
103
123
}
0 commit comments