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

Kubetest2 - use our own tester that wraps kubetest2's ginkgo tester #10549

Merged
merged 5 commits into from
Jan 11, 2021

Conversation

rifelpet
Copy link
Member

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

This allows us to share tester flags (package version and bucket) for downloading kubectl while passing them to the ginkgo tester
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 10, 2021
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 10, 2021
@rifelpet
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws-kubetest

@k8s-ci-robot
Copy link
Contributor

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

  • /test pull-kops-e2e-cni-amazonvpc
  • /test pull-kops-e2e-cni-calico
  • /test pull-kops-e2e-cni-canal
  • /test pull-kops-e2e-cni-cilium
  • /test pull-kops-e2e-cni-flannel
  • /test pull-kops-e2e-cni-kuberouter
  • /test pull-kops-e2e-cni-weave
  • /test pull-kops-bazel-build
  • /test pull-kops-bazel-test
  • /test pull-kops-e2e-kubernetes-aws
  • /test pull-kops-e2e-kubernetes-aws-kubetest2
  • /test pull-kops-e2e-k8s-containerd
  • /test pull-kops-verify-bazel
  • /test pull-kops-verify-generated
  • /test pull-kops-verify-gomod
  • /test pull-kops-verify-boilerplate
  • /test pull-kops-verify-gofmt
  • /test pull-kops-verify-govet
  • /test pull-kops-verify-staticcheck
  • /test pull-kops-verify-hashes
  • /test pull-kops-verify-terraform
  • /test pull-kops-verify-cloudformation

Use /test all to run the following jobs:

  • pull-kops-bazel-build
  • pull-kops-bazel-test
  • pull-kops-e2e-kubernetes-aws
  • pull-kops-verify-bazel
  • pull-kops-verify-generated
  • pull-kops-verify-gomod
  • pull-kops-verify-boilerplate
  • pull-kops-verify-gofmt
  • pull-kops-verify-govet
  • pull-kops-verify-staticcheck

In response to this:

/test pull-kops-e2e-kubernetes-aws-kubetest

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.

@rifelpet
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws-kubetest2

@olemarkus
Copy link
Member

Looks like it is still using 1.20.1 client against the 1.19.4 test cases.

}
t.Ginkgo.TestPackageVersion = lines[0]

klog.V(1).Infof("Kubectl package version was not specified. Defaulting to latest: %s", t.Ginkgo.TestPackageVersion)
Copy link
Member

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!

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))
Copy link
Member

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)

@justinsb
Copy link
Member

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.

@rifelpet
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws-kubetest2

I was wrapping the ginkgo tester functions in a way that pretestSetup was never actually being called
@rifelpet
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws-kubetest2

1 similar comment
@rifelpet
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws-kubetest2

@rifelpet
Copy link
Member Author

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.

https://github.com/kubernetes-sigs/kubetest2/blob/5a41a5dbafe58ff0dc59a85acc6cd62f08db5d8f/pkg/testers/ginkgo/ginkgo.go#L114-L117

I'll do some more experimenting locally and try and come up with a better way of wrapping the upstream ginkgo tester

@rifelpet
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws-kubetest2

@rifelpet
Copy link
Member Author

/test pull-kops-e2e-kubernetes-aws-kubetest2

@olemarkus
Copy link
Member

Looks good now!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 11, 2021
@k8s-ci-robot k8s-ci-robot merged commit f4c9b27 into kubernetes:master Jan 11, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Jan 11, 2021
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. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants