Skip to content

Commit

Permalink
Merge pull request #5523 from profnandaa/tests-4485-revisit-frontend
Browse files Browse the repository at this point in the history
tests: add `testDockerfileFromHTTP` for WCOW
  • Loading branch information
tonistiigi authored Nov 19, 2024
2 parents edaa93d + ca6e771 commit 2d013b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion client/llb/fileop.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
_ "crypto/sha256" // for opencontainers/go-digest
"os"
"path"
"path/filepath"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -563,7 +564,7 @@ func (a *fileActionCopy) toProtoAction(ctx context.Context, parent string, base
}

func (a *fileActionCopy) sourcePath(ctx context.Context) (string, error) {
p := path.Clean(a.src)
p := filepath.ToSlash(path.Clean(a.src))
dir := "/"
var err error
if !path.IsAbs(p) {
Expand Down
6 changes: 3 additions & 3 deletions frontend/dockerfile/dockerfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4491,7 +4491,6 @@ COPY --from=build foo bar2
}

func testDockerfileFromHTTP(t *testing.T, sb integration.Sandbox) {
integration.SkipOnPlatform(t, "windows")
f := getFrontend(t, sb)

buf := bytes.NewBuffer(nil)
Expand All @@ -4509,9 +4508,10 @@ func testDockerfileFromHTTP(t *testing.T, sb integration.Sandbox) {
require.NoError(t, err)
}

writeFile("mydockerfile", `FROM scratch
dockerfile := fmt.Sprintf(`FROM %s
COPY foo bar
`)
`, integration.UnixOrWindows("scratch", "nanoserver"))
writeFile("mydockerfile", dockerfile)

writeFile("foo", "foo-contents")

Expand Down

0 comments on commit 2d013b6

Please sign in to comment.