Add Windows e2e tests via kind-in-WSL#1793
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Copilot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
@copilot you can try https://github.com/tg123/oci-to-wsl to import a kind image, no wsl setup required i believe, it is default on check this pipeline for ref https://github.com/tg123/oci-to-wsl/blob/main/.github/workflows/e2e.yml |
Switched to |
|
@copilot fix ci ⠸ Importing into WSL [17s] WSL distribution "kind" created successfully. seems kind starting issue |
The root cause was line endings: GitHub's Windows runners check out with |
|
@copilot seems kind is good now, but test is not happy, please check |
Done in 5f8cdaa.
The test failure was |
There was no end-to-end coverage running on Windows against a real cluster. Windows runners can't run a Linux Kubernetes distro natively, so this runs Kubernetes inside WSL and reaches it from the Windows host process via WSL2 localhost forwarding.
CI —
e2e-windows-wsljob inbuildtest.yamlwindows-latest, which already has WSL2 enabled by default, so no separate WSL provisioning action is required.oci-to-wsl(download checksum-verified) to import thekindest/nodeimage directly into WSL as a systemd-enabled distro via.github/e2e/kind-wsl.yaml. Kubernetes runs natively in WSL — no Docker daemon and no nested containers..github/e2e/bootstrap-kind.shbrings up a single-node control plane in place (kubeadm init, untaint the control-plane node, apply the bundled kindnet CNI, wait for Ready) and the job exports a kubeconfig rewritten tohttps://127.0.0.1:6443.e2esuite onto Windows: it runsdotnet test tests/E2E.Testsanddotnet test tests/E2E.Aot.Testsagainst127.0.0.1with the same "cases must not be skipped" guard as the existing e2e jobs.127.0.0.1:6443connections to be actively refused), the job holds an idle background WSL session open and waits for127.0.0.1:6443to accept connections before running the tests.Line endings
*.shis pinned to LF in.gitattributessobootstrap-kind.shisn't checked out with CRLF on the Windows runner (a trailing\rturnedset -euxo pipefailinto an invalid option and aborted the bootstrap).Notes for reviewers
kubeadmbootstrap) can only be exercised on the actual Windows runner.tests/E2E.Classic.Tests) has been removed in favor of reusing the existing Linux e2e suite.