-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Kubetest2 - use our own tester that wraps kubetest2's ginkgo tester #10549
Conversation
This allows us to share tester flags (package version and bucket) for downloading kubectl while passing them to the ginkgo tester
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rifelpet 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 |
/test pull-kops-e2e-kubernetes-aws-kubetest |
@rifelpet: The specified target(s) for
Use
In response to this:
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. |
/test pull-kops-e2e-kubernetes-aws-kubetest2 |
Looks like it is still using 1.20.1 client against the 1.19.4 test cases. |
tests/e2e/pkg/tester/kubectl.go
Outdated
} | ||
t.Ginkgo.TestPackageVersion = lines[0] | ||
|
||
klog.V(1).Infof("Kubectl package version was not specified. Defaulting to latest: %s", t.Ginkgo.TestPackageVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could log this without V(1) (i.e. at v=0), particularly as it seems like it's still giving us some trouble!
tests/e2e/pkg/tester/tester.go
Outdated
return fmt.Errorf("failed to get kubectl package from published releases: %s", err) | ||
} | ||
existingPath := os.Getenv("PATH") | ||
os.Setenv("PATH", fmt.Sprintf("%v:%v", kubectlPath, existingPath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think kubectlPath is the full path to kubectl here. If that's right, we would probably want something like filepath.Dir(kubectlPath)
I like the approach - taking control of this code will let us better understand what's happening in the tests and add our own tests. |
/test pull-kops-e2e-kubernetes-aws-kubetest2 |
I was wrapping the ginkgo tester functions in a way that pretestSetup was never actually being called
/test pull-kops-e2e-kubernetes-aws-kubetest2 |
1 similar comment
/test pull-kops-e2e-kubernetes-aws-kubetest2 |
Ok it looks like the upstream tester's flag parsing doesn't happen until after we can download kubectl, so the bucket and version strings aren't yet set. I'll do some more experimenting locally and try and come up with a better way of wrapping the upstream ginkgo tester |
/test pull-kops-e2e-kubernetes-aws-kubetest2 |
c5bdfac
to
f671acc
Compare
/test pull-kops-e2e-kubernetes-aws-kubetest2 |
Looks good now! |
This allows us to share tester flags (package version and bucket) for downloading kubectl while passing them to the ginkgo tester. The kubectl.go file is essentially copied from kubetest2-tester-ginkgo's package.go that downloads the e2e.test binary