File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -153,11 +153,20 @@ func TestMemcached(t *testing.T) {
153
153
// t.Fatalf("Could not write deploy/operator.yaml: %v", err)
154
154
// }
155
155
156
- cmdOut , err = exec .Command ("operator-sdk" ,
156
+ cmd : = exec .Command ("operator-sdk" ,
157
157
"add" ,
158
158
"api" ,
159
159
"--api-version=cache.example.com/v1alpha1" ,
160
- "--kind=Memcached" ).CombinedOutput ()
160
+ "--kind=Memcached" )
161
+ // Generators will print errors if -v is set.
162
+ gf , ok := os .LookupEnv (projutil .GoFlagsEnv )
163
+ if ok {
164
+ os .Setenv (projutil .GoFlagsEnv , "\" " + strings .Trim (gf , "\" " )+ " -v" + "\" " )
165
+ } else {
166
+ os .Setenv (projutil .GoFlagsEnv , `"-v"` )
167
+ }
168
+ cmd .Env = os .Environ ()
169
+ cmdOut , err = cmd .CombinedOutput ()
161
170
if err != nil {
162
171
t .Fatalf ("Error: %v\n Command Output: %s\n " , err , string (cmdOut ))
163
172
}
You can’t perform that action at this time.
0 commit comments