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

✨ Support e2e for WSL #10402

Merged
merged 1 commit into from
Apr 15, 2024
Merged

✨ Support e2e for WSL #10402

merged 1 commit into from
Apr 15, 2024

Conversation

nasusoba
Copy link
Contributor

@nasusoba nasusoba commented Apr 9, 2024

What this PR does / why we need it:
When running e2e with WSL, the API address from the Docker network could not be used to connect to the workload cluster, instead, we need to use localhost:load-balancer-host-port. fixConfig done the fix, but for now it only applies to darwin.

This PR add check to see if the current environment is WSL, based on the env variable WSL_DISTRO_NAME. If so, it will use load balancer host port to access the workload cluster.

After the fix, on WSL, the e2e will be supported.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #10103

/area testing

@k8s-ci-robot k8s-ci-robot added the area/testing Issues or PRs related to testing label Apr 9, 2024
Copy link

linux-foundation-easycla bot commented Apr 9, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 9, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @nasusoba!

It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 9, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @nasusoba. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 9, 2024
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 9, 2024
@nasusoba
Copy link
Contributor Author

nasusoba commented Apr 9, 2024

need to verify if this change breaks normal Linux Docker engine (that is not WSL)...

@killianmuldoon
Copy link
Contributor

If you can that would be good - but I think this change will run through the e2e tests in linux so we should have at least one data point

@nasusoba nasusoba marked this pull request as draft April 9, 2024 09:02
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2024
@sbueringer sbueringer marked this pull request as ready for review April 9, 2024 17:33
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2024
@sbueringer
Copy link
Member

/approve

/assign @chrischdi

Thx folks for testing!

Let's go ahead with this.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 9, 2024
@nasusoba
Copy link
Contributor Author

Seems that the conformance test is broken after the change... kubetest relies on docker network ref . Need more works to check nothing is broken for all platforms

@killianmuldoon
Copy link
Contributor

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 10, 2024
@chrischdi
Copy link
Member

/test help

@k8s-ci-robot
Copy link
Contributor

@chrischdi: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-blocking-main
  • /test pull-cluster-api-e2e-conformance-ci-latest-main
  • /test pull-cluster-api-e2e-conformance-main
  • /test pull-cluster-api-e2e-dualstack-and-ipv6-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-e2e-mink8s-main
  • /test pull-cluster-api-e2e-upgrade-1-29-1-30-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-blocking-main
  • pull-cluster-api-test-main
  • pull-cluster-api-verify-main

In response to this:

/test help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@chrischdi
Copy link
Member

/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-dualstack-and-ipv6-main
/test pull-cluster-api-e2e-main

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 11, 2024
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 12, 2024
@nasusoba nasusoba changed the title ✨ Support e2e for WSL by running fixConfig for all platforms ✨ Support e2e for WSL Apr 12, 2024
@nasusoba
Copy link
Contributor Author

I'm able to get the conformance test run on WSL, but there are still two failures for kubetest, does anyone have any clue why it is failing?

 Apr 12 09:53:12.500: INFO: Service reachability failing with error: error running /usr/local/bin/kubectl --kubeconfig=/tmp/kubeconfig --namespace=services-7890 exec execpod-affinity9bnjm -- /bin/sh -x -c echo hostName | nc -v -t -w 2 affinity-clusterip-transition 80:
    Command stdout:
  
    stderr:
    + echo hostName
    + nc -v -t -w 2 affinity-clusterip-transition 80
    nc: connect to affinity-clusterip-transition port 80 (tcp) timed out: Operation in progress
    command terminated with exit code 1
  
    error:
    exit status 1
    Retrying...
    Apr 12 09:53:12.500: INFO: Unexpected error: 
        <*errors.errorString | 0xc001853280>: 
        service is not reachable within 2m0s timeout on endpoint affinity-clusterip-transition:80 over TCP protocol
        {
            s: "service is not reachable within 2m0s timeout on endpoint affinity-clusterip-transition:80 over TCP protocol",
        }
    [FAILED] in [It] - test/e2e/network/service.go:4024 @ 04/12/24 09:53:12.5
    Apr 12 09:53:12.500: INFO: Cleaning up the exec pod

...

 Summarizing 2 Failures:
    [FAIL] [sig-network] Services [It] should have session affinity work for NodePort service [LinuxOnly] [Conformance] [sig-network, Conformance]
    test/e2e/network/service.go:4024
    [FAIL] [sig-network] Services [It] should be able to switch session affinity for service with type clusterIP [LinuxOnly] [Conformance] [sig-network, Conformance]
    test/e2e/network/service.go:4024
  
  Ran 138 of 7407 Specs in 3604.191 seconds
  FAIL! - Suite Timeout Elapsed -- 136 Passed | 2 Failed | 1 Flaked | 0 Pending | 7269 Skipped

@sbueringer
Copy link
Member

Sorry, no idea. In general if it helps, it's fine to incrementally improve (and merge) and that only these tests fail is a big step forward

@nasusoba nasusoba marked this pull request as ready for review April 13, 2024 15:57
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 13, 2024
@nasusoba
Copy link
Contributor Author

@chrischdi, I have verified the change enables e2e on WSL. Please help continue with the review!

@chrischdi
Copy link
Member

/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-dualstack-and-ipv6-main
/test pull-cluster-api-e2e-main

Signed-off-by: nasusoba <zhengrunyu2020@outlook.com>
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 15, 2024
@chrischdi
Copy link
Member

/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-dualstack-and-ipv6-main
/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member

/lgtm
/approve

Fine to merge (remove hold) from my side

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 15, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 08dddd4c4465a4c0839419a3d18441701e7b46b8

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

Also for me

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 15, 2024
@k8s-ci-robot k8s-ci-robot merged commit e05f714 into kubernetes-sigs:main Apr 15, 2024
28 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone Apr 15, 2024
@nasusoba nasusoba deleted the wsl branch April 16, 2024 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/testing Issues or PRs related to testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for running E2E tests on WSL
5 participants