diff --git a/frontend/dockerfile/dockerfile_test.go b/frontend/dockerfile/dockerfile_test.go index d8aed914b3a6..8aa62d591ac0 100644 --- a/frontend/dockerfile/dockerfile_test.go +++ b/frontend/dockerfile/dockerfile_test.go @@ -5724,10 +5724,10 @@ RUN echo bar > bar } func testNoCache(t *testing.T, sb integration.Sandbox) { - integration.SkipOnPlatform(t, "windows") f := getFrontend(t, sb) - dockerfile := []byte(` + dockerfile := []byte(integration.UnixOrWindows( + ` FROM busybox AS s0 RUN cat /dev/urandom | head -c 100 | sha256sum | tee unique FROM busybox AS s1 @@ -5735,7 +5735,18 @@ RUN cat /dev/urandom | head -c 100 | sha256sum | tee unique2 FROM scratch COPY --from=s0 unique / COPY --from=s1 unique2 / -`) +`, + ` +FROM nanoserver AS s0 +RUN echo test> unique +FROM nanoserver AS s1 +RUN echo test> unique2 +FROM nanoserver +COPY --from=s0 unique / +COPY --from=s1 unique2 / +`, + )) + dir := integration.Tmpdir( t, fstest.CreateFile("Dockerfile", dockerfile, 0600), @@ -5784,8 +5795,8 @@ COPY --from=s1 unique2 / unique2Dir2, err := os.ReadFile(filepath.Join(destDir2, "unique2")) require.NoError(t, err) - require.NotEqual(t, string(unique1Dir1), string(unique1Dir2)) - require.NotEqual(t, string(unique2Dir1), string(unique2Dir2)) + require.NotEqual(t, integration.UnixOrWindows(string(unique1Dir1), string(unique1Dir1)+"\r\n"), string(unique1Dir2)) + require.NotEqual(t, integration.UnixOrWindows(string(unique2Dir1), string(unique2Dir1)+"\r\n"), string(unique2Dir2)) destDir3 := t.TempDir() @@ -5802,7 +5813,7 @@ COPY --from=s1 unique2 / require.NoError(t, err) require.Equal(t, string(unique1Dir2), string(unique1Dir3)) - require.NotEqual(t, string(unique2Dir1), string(unique2Dir3)) + require.NotEqual(t, integration.UnixOrWindows(string(unique2Dir1), string(unique2Dir1)+"\r\n"), string(unique2Dir3)) } // moby/buildkit#5305