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: enable integration test run on windows as baseline #4479

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

profnandaa
Copy link
Collaborator

@profnandaa profnandaa commented Dec 12, 2023

The plan is to skip all the failing tests on windows so as to have the CI running on WS2022; and then we will go fixing each tests and enabling them in separate PRs -- see tracking issue here #4485

This will be a helpful approach as we bring parity between windows and unix.

I think skipping failing tests on Windows is ok to get a general view of which ones currently do not work. As we move forward, we can move them one by one in a platform specific _test.go file if they don't make sense at all on Windows (like testShmSize) and enable the ones that should absolutely work on Windows such as: https:/moby/buildkit/pull/4479/files#diff-93731187c2a292b7e92b852225675f88b41b7634dafd66cfeab50697bd806ddbR3053
If we ever manage to enable LCOW support, then we can enable linux specific tests on Windows as well, but until then we need to focus on WCOW. -- @gabriel-samfira

@profnandaa profnandaa force-pushed the windows/int-test-run branch 2 times, most recently from 13cf1c3 to 54282a9 Compare December 12, 2023 05:38
@gabriel-samfira
Copy link
Collaborator

I think skipping failing tests on Windows is ok to get a general view of which ones currently do not work. As we move forward, we can move them one by one in a platform specific _test.go file if they don't make sense at all on Windows (like testShmSize) and enable the ones that should absolutely work on Windows such as:

https:/moby/buildkit/pull/4479/files#diff-93731187c2a292b7e92b852225675f88b41b7634dafd66cfeab50697bd806ddbR3053

If we ever manage to enable LCOW support, then we can enable linux specific tests on Windows as well, but until then we need to focus on WCOW.

util/testutil/integration/run.go Outdated Show resolved Hide resolved
"dns": bridgeDNSNetwork,
}),
)
if runtime.GOOS != "windows" {
Copy link
Member

Choose a reason for hiding this comment

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

Each individual test in testBridgeNetworkingDNSNoRootless should instead declare that it cannot be run in windows, right?

I want to avoid as many explicit runtime.GOOS != "windows" checks as possible, they're a little inflexible, and complicate reading the code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason, even with the line to skip at the beginning of the function, some set up was still being done; so I'd to guard this. Any tips will be appreciated.

Here's the trace:

        	Error Trace:	C:/buildkit/util/testutil/integration/run.go:198
        	Error:      	Received unexpected error:
        	            	process exited: C:\Users\Administrator\go\bin\buildkitd.exe --containerd-worker-gc=false --containerd-worker=true --containerd-worker-addr npipe:////./pipe/containerd-bktest_containerd2165329572 --containerd-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=C:\Users\ADMINI~1\AppData\Local\Temp\2\bktest_config1965241481\buildkitd.toml --root C:\Users\ADMINI~1\AppData\Local\Temp\2\bktest_buildkitd2000050298 --addr npipe:////./pipe/buildkitd-bktest_buildkitd2000050298 --debug
        	            	github.com/moby/buildkit/util/testutil/integration.WaitSocket
        	            		C:/buildkit/util/testutil/integration/util.go:111
        	            	github.com/moby/buildkit/util/testutil/workers.runBuildkitd
        	            		C:/buildkit/util/testutil/workers/util.go:93
        	            	github.com/moby/buildkit/util/testutil/workers.(*Containerd).New
        	            		C:/buildkit/util/testutil/workers/containerd.go:228
        	            	github.com/moby/buildkit/util/testutil/integration.newSandbox
        	            		C:/buildkit/util/testutil/integration/sandbox.go:100
        	            	github.com/moby/buildkit/util/testutil/integration.Run.func3.1
        	            		C:/buildkit/util/testutil/integration/run.go:197
        	            	testing.tRunner
        	            		C:/Program Files/Go/src/testing/testing.go:1595
        	            	runtime.goexit
        	            		C:/Program Files/Go/src/runtime/asm_amd64.s:1650
        	            	creating worker
        	            	github.com/moby/buildkit/util/testutil/integration.newSandbox
        	            		C:/buildkit/util/testutil/integration/sandbox.go:102
        	            	github.com/moby/buildkit/util/testutil/integration.Run.func3.1
        	            		C:/buildkit/util/testutil/integration/run.go:197
        	            	testing.tRunner
        	            		C:/Program Files/Go/src/testing/testing.go:1595
        	            	runtime.goexit
        	            		C:/Program Files/Go/src/runtime/asm_amd64.s:1650
        	Test:       	TestIntegration/TestBridgeNetworkingDNSNoRootless/worker=containerd/netmode=dns
    --- FAIL: TestIntegration/TestBridgeNetworkingDNSNoRootless/worker=containerd/netmode=dns (20.22s)
    ```

@profnandaa profnandaa changed the title tests: enable integration test run on windows tests: enable integration test run on windows as baseline Dec 13, 2023
@profnandaa profnandaa force-pushed the windows/int-test-run branch 3 times, most recently from 65cee0f to 8f4aad6 Compare December 13, 2023 07:29
@profnandaa profnandaa marked this pull request as ready for review December 13, 2023 07:30
@profnandaa profnandaa force-pushed the windows/int-test-run branch 6 times, most recently from 1ef27eb to fe257a5 Compare December 13, 2023 21:33
The plan is to enable to skip all the failing tests on
windows so as to have the CI running on WS2022; and
then we will go fixing each tests and enabling them in
separate PRs. This is the baseline.

This will be a helpful approach as we bring parity
between windows and unix.

Signed-off-by: Anthony Nandaa <[email protected]>
@@ -20,7 +20,7 @@ on:

env:
GO_VERSION: "1.21"
TESTFLAGS: "-v --parallel=6 --timeout=30m"
TESTFLAGS: "-v --parallel=6 --timeout=60m"
Copy link
Member

Choose a reason for hiding this comment

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

not for this PR but if this gets too long we need to split this suite to multiple parallel workers

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, for now we just have those 3.

$version = [regex]::Match($goModFileContent, $pattern).Value
mkdir -p .\bin\installs -f
cd .\bin\installs
git clone https:/containerd/containerd.git
Copy link
Member

Choose a reason for hiding this comment

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

Eventually, this would need to be done with the Dockerfile. Either directly on windows or cross-compiled on linux. Eg. freebsd task in this file does the cross-compile.

Copy link
Collaborator Author

@profnandaa profnandaa Dec 14, 2023

Choose a reason for hiding this comment

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

Good call out. Eventually, we will need to explore buildkitd running in the container (WCOW).

Copy link
Member

Choose a reason for hiding this comment

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

Yes and same for distribution binaries, can look at this in follow-up 👍

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

LGTM to start with thanks

As follow-up we should cross comp container/distribution binaries to avoid drifting like freebsd one and most of this logic should be moved to https:/moby/buildkit/blob/master/.github/workflows/.test.yml where we are self-contained and run integration tests through a WCOW container. As I see it we would have a common .test.yml that would either call a .test-linux.yml, .test-windows.yml reusable workflow depending on a new "os" input. We could then also have a .test-freebsd.yml so we can remove the test-os.yml workflow.

$version = [regex]::Match($goModFileContent, $pattern).Value
mkdir -p .\bin\installs -f
cd .\bin\installs
git clone https:/containerd/containerd.git
Copy link
Member

Choose a reason for hiding this comment

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

Yes and same for distribution binaries, can look at this in follow-up 👍

Copy link
Collaborator

@gabriel-samfira gabriel-samfira left a comment

Choose a reason for hiding this comment

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

LGTM. The tests directly under ./frontend might pass. Could you try them out locally and maybe enable them if they do? Would be a shame not to run them if they work.

frontend/frontend_test.go Show resolved Hide resolved
frontend/frontend_test.go Show resolved Hide resolved
@profnandaa
Copy link
Collaborator Author

@crazy-max -- thanks, taking note of that. Adding it as a task on the main tracking issue here #4485

@gabriel-samfira gabriel-samfira merged commit 8c4da32 into moby:master Dec 14, 2023
60 checks passed
@profnandaa profnandaa deleted the windows/int-test-run branch December 18, 2023 05:07
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.

5 participants