Skip to content

Commit

Permalink
Merge pull request moby#8289 from duglin/FixTestcaseFor8230
Browse files Browse the repository at this point in the history
Fixes the new testcase for PR moby#8230
  • Loading branch information
vieux committed Sep 29, 2014
2 parents a7d61e0 + 8b3fbac commit 7c1aee6
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions integration-cli/docker_cli_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,8 @@ func TestBuildCopyWildcardNoFind(t *testing.T) {
func TestBuildCopyWildcardCache(t *testing.T) {
name := "testcopywildcardcache"
defer deleteImages(name)
server, err := fakeStorage(map[string]string{
"robots.txt": "hello",
"index.html": "world",
})
if err != nil {
t.Fatal(err)
}
defer server.Close()
ctx, err := fakeContext(`FROM busybox
COPY file1.txt /tmp/
`,
COPY file1.txt /tmp/`,
map[string]string{
"file1.txt": "test1",
})
Expand All @@ -315,30 +306,17 @@ func TestBuildCopyWildcardCache(t *testing.T) {
t.Fatal(err)
}

if err != nil {
t.Fatal(err)
}
id1, err := buildImageFromContext(name, ctx, true)
if err != nil {
t.Fatal(err)
}

// Now make sure we use a cache the 2nd time even with wild card
ctx2, err := fakeContext(`FROM busybox
COPY file*.txt /tmp/
`,
map[string]string{
"file1.txt": "test1",
})
defer ctx2.Close()
if err != nil {
t.Fatal(err)
}
// Now make sure we use a cache the 2nd time even with wild cards.
// Use the same context so the file is the same and the checksum will match
ctx.Add("Dockerfile", `FROM busybox
COPY file*.txt /tmp/`)

if err != nil {
t.Fatal(err)
}
id2, err := buildImageFromContext(name, ctx2, true)
id2, err := buildImageFromContext(name, ctx, true)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 7c1aee6

Please sign in to comment.