Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: frontend/dockerfile: update integration tests for windows/wcow #5382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielGithinji
Copy link

@danielGithinji danielGithinji commented Oct 2, 2024

Updated tests in frontend/dockerfile/dockerfile_test.go to run on Windows.
Partially addressing #4485

  • testCopyThroughSymlinkContext
  • testIgnoreEntrypoint
  • testQuotedMetaArgs
  • testDockerfileCheckHostname
  • testEmptyStages
  • testNamedImageContextScratch
  • testNamedImageContextPlatform

Copy link
Collaborator

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than those comments, the rest LGTM.

May be just update your commit message too to match the PR, with the subject:
tests: frontend/dockerfile: update integration tests for windows/wcow

frontend/dockerfile/dockerfile_test.go Outdated Show resolved Hide resolved
frontend/dockerfile/dockerfile_test.go Outdated Show resolved Hide resolved
frontend/dockerfile/dockerfile_test.go Show resolved Hide resolved
frontend/dockerfile/dockerfile_test.go Show resolved Hide resolved
- [x] `testCopyThroughSymlinkContext`
- [x] `testIgnoreEntrypoint`
- [x] `testQuotedMetaArgs`
- [x] `testDockerfileCheckHostname`
- [x] `testEmptyStages`
- [x] `testNamedImageContextScratch`
- [x] `testNamedImageContextPlatform`

Signed-off-by: Daniel Githinji <danskigee@gmail.com>
@danielGithinji danielGithinji marked this pull request as ready for review November 5, 2024 06:20
`,
`
FROM nanoserver
RUN reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname| findstr "foo"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we will need to check if this command actually returned something or failed and exit appropriately,

f := getFrontend(t, sb)
dockerfile := []byte(`
dockerfile := []byte(integration.UnixOrWindows(
`
ARG foo=bar
Copy link

@billywr billywr Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARG foo=bar is same for both linux and windows no need to use .UnixOrWindows

@@ -6708,7 +6743,14 @@ func testNamedImageContextPlatform(t *testing.T, sb integration.Sandbox) {
require.NoError(t, err)

// Build a base image and force buildkit to generate a manifest list.
dockerfile := []byte(`FROM --platform=$BUILDPLATFORM alpine:latest`)
dockerfile := []byte(integration.UnixOrWindows(
Copy link

@billywr billywr Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lin 6746 to 6753 can be collapsed to

baseImage := integration.UnixOrWindows(
	"alpine",
	"nanoserver",
)

dockerfile := []byte(fmt.Sprintf(`FROM --platform=$BUILDPLATFORM %s:latest`, baseImage))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants