Browse code

integ-cli: a few context cleanups

These cleanup calls were forgotten, adding these to
reduce garbage on windows CI machines.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>

Ahmet Alp Balkan authored on 2015/02/25 17:53:43
Showing 1 changed files
... ...
@@ -2563,6 +2563,10 @@ func TestBuildConditionalCache(t *testing.T) {
2563 2563
 	ctx, err := fakeContext(dockerfile, map[string]string{
2564 2564
 		"foo": "hello",
2565 2565
 	})
2566
+	if err != nil {
2567
+		t.Fatal(err)
2568
+	}
2569
+	defer ctx.Close()
2566 2570
 
2567 2571
 	id1, err := buildImageFromContext(name, ctx, true)
2568 2572
 	if err != nil {
... ...
@@ -3453,6 +3457,8 @@ func TestBuildDockerignoringDockerfile(t *testing.T) {
3453 3453
 	if err != nil {
3454 3454
 		t.Fatal(err)
3455 3455
 	}
3456
+	defer ctx.Close()
3457
+
3456 3458
 	if _, err = buildImageFromContext(name, ctx, true); err != nil {
3457 3459
 		t.Fatalf("Didn't ignore Dockerfile correctly:%s", err)
3458 3460
 	}
... ...
@@ -3483,6 +3489,8 @@ func TestBuildDockerignoringRenamedDockerfile(t *testing.T) {
3483 3483
 	if err != nil {
3484 3484
 		t.Fatal(err)
3485 3485
 	}
3486
+	defer ctx.Close()
3487
+
3486 3488
 	if _, err = buildImageFromContext(name, ctx, true); err != nil {
3487 3489
 		t.Fatalf("Didn't ignore MyDockerfile correctly:%s", err)
3488 3490
 	}
... ...
@@ -3803,6 +3811,8 @@ RUN    [ "$abc" = "\\\"foo\\\"" ]
3803 3803
 	if err != nil {
3804 3804
 		t.Fatal(err)
3805 3805
 	}
3806
+	defer ctx.Close()
3807
+
3806 3808
 	_, err = buildImageFromContext(name, ctx, true)
3807 3809
 	if err != nil {
3808 3810
 		t.Fatal(err)