Skip to content

Commit

Permalink
Rewrite TestBuildForceRm to not use fixtures
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
  • Loading branch information
LK4D4 committed Sep 24, 2014
1 parent 8dd11c7 commit 1625cbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions integration-cli/build_tests/TestBuildForceRm/Dockerfile

This file was deleted.

12 changes: 9 additions & 3 deletions integration-cli/docker_cli_build_test.go
Expand Up @@ -604,10 +604,16 @@ func TestBuildForceRm(t *testing.T) {
if err != nil {
t.Fatalf("failed to get the container count: %s", err)
}
name := "testbuildforcerm"
defer deleteImages(name)
ctx, err := fakeContext("FROM scratch\nRUN true\nRUN thiswillfail", nil)
if err != nil {
t.Fatal(err)
}
defer ctx.Close()

buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestBuildForceRm")
buildCmd := exec.Command(dockerBinary, "build", "--force-rm", ".")
buildCmd.Dir = buildDirectory
buildCmd := exec.Command(dockerBinary, "build", "-t", name, "--force-rm", ".")
buildCmd.Dir = ctx.Dir
_, exitCode, err := runCommandWithOutput(buildCmd)

if err == nil || exitCode == 0 {
Expand Down

0 comments on commit 1625cbf

Please sign in to comment.