|
@@ -4901,3 +4901,38 @@ func TestBuildDotDotFile(t *testing.T) {
|
|
}
|
|
}
|
|
logDone("build - ..file")
|
|
logDone("build - ..file")
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func TestBuildNotVerbose(t *testing.T) {
|
|
|
|
+ defer deleteAllContainers()
|
|
|
|
+ defer deleteImages("verbose")
|
|
|
|
+
|
|
|
|
+ ctx, err := fakeContext("FROM busybox\nENV abc=hi\nRUN echo $abc there", map[string]string{})
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatal(err)
|
|
|
|
+ }
|
|
|
|
+ defer ctx.Close()
|
|
|
|
+
|
|
|
|
+ // First do it w/verbose - baseline
|
|
|
|
+ buildCmd := exec.Command(dockerBinary, "build", "--no-cache", "-t", "verbose", ".")
|
|
|
|
+ buildCmd.Dir = ctx.Dir
|
|
|
|
+ out, _, err := runCommandWithOutput(buildCmd)
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatalf("failed to build the image w/o -q: %s, %v", out, err)
|
|
|
|
+ }
|
|
|
|
+ if !strings.Contains(out, "hi there") {
|
|
|
|
+ t.Fatalf("missing output:%s\n", out)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Now do it w/o verbose
|
|
|
|
+ buildCmd = exec.Command(dockerBinary, "build", "--no-cache", "-q", "-t", "verbose", ".")
|
|
|
|
+ buildCmd.Dir = ctx.Dir
|
|
|
|
+ out, _, err = runCommandWithOutput(buildCmd)
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatalf("failed to build the image w/ -q: %s, %v", out, err)
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(out, "hi there") {
|
|
|
|
+ t.Fatalf("Bad output, should not contain 'hi there':%s", out)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ logDone("build - not verbose")
|
|
|
|
+}
|