Skip to content

Commit 613ac72

Browse files
committed
verbose code generation in e2e test
1 parent 1da3de9 commit 613ac72

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/e2e/memcached_test.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,20 @@ func TestMemcached(t *testing.T) {
153153
// t.Fatalf("Could not write deploy/operator.yaml: %v", err)
154154
// }
155155

156-
cmdOut, err = exec.Command("operator-sdk",
156+
cmd := exec.Command("operator-sdk",
157157
"add",
158158
"api",
159159
"--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()
161170
if err != nil {
162171
t.Fatalf("Error: %v\nCommand Output: %s\n", err, string(cmdOut))
163172
}

0 commit comments

Comments
 (0)