mirror of https://github.com/docker/docs.git
Rewrite TestBuildForceRm to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
parent
8dd11c7175
commit
1625cbfc4c
|
@ -1,3 +0,0 @@
|
||||||
FROM busybox
|
|
||||||
RUN true
|
|
||||||
RUN thiswillfail
|
|
|
@ -604,10 +604,16 @@ func TestBuildForceRm(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to get the container count: %s", err)
|
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", "-t", name, "--force-rm", ".")
|
||||||
buildCmd := exec.Command(dockerBinary, "build", "--force-rm", ".")
|
buildCmd.Dir = ctx.Dir
|
||||||
buildCmd.Dir = buildDirectory
|
|
||||||
_, exitCode, err := runCommandWithOutput(buildCmd)
|
_, exitCode, err := runCommandWithOutput(buildCmd)
|
||||||
|
|
||||||
if err == nil || exitCode == 0 {
|
if err == nil || exitCode == 0 {
|
||||||
|
|
Loading…
Reference in New Issue