cluster-api-provider-vsphere icon indicating copy to clipboard operation
cluster-api-provider-vsphere copied to clipboard

Move e2e test setup from Bash to go

Open randomvariable opened this issue 2 years ago • 9 comments

/kind feature

Describe the solution you'd like

hack/e2e.sh includes a bunch of Node IPAM setup code that would better be served being added to a ginkgo SynchronizedBeforeSuite setup for better debuggability.

CAPA has good examples of using this method to pass data to test suites in https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/test/e2e/suites/conformance/conformance_suite_test.go#L45C7-L49 and https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/test/e2e/shared/suite.go#L209-L269

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

randomvariable avatar Jul 20 '23 09:07 randomvariable

Sounds great. Let's just be careful with introducing additional Go dependencies that could lead to problems (e.g. importing some API types which then makes us dependent on a specific controller-runtime version)

sbueringer avatar Jul 20 '23 13:07 sbueringer

To give an example. This api group for example: https://github.com/metal3-io/ip-address-manager/blob/main/api/v1alpha1/ipaddress_webhook.go

But I'm pretty sure we can work around this by e.g. just using Unstructured

sbueringer avatar Jul 20 '23 13:07 sbueringer

Yeah, that's probably best. There's also some very nice quality of life stuff in the CAPA one, especially the goroutines that captures logs on a ticker that you can run when developing e2e tests and testing code.

Can probably also use govmomi to execute commands on hosts using vm guest tools in the same way that AWS SSM has a backdoor into hosts.

randomvariable avatar Jul 20 '23 13:07 randomvariable

/help

sbueringer avatar Aug 18 '23 12:08 sbueringer

@sbueringer: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

/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.

k8s-ci-robot avatar Aug 18 '23 12:08 k8s-ci-robot

Note: Cloud Provider vSphere seems to use the same infra + script (minus our latest changes): https://github.com/kubernetes/cloud-provider-vsphere/blob/master/hack/e2e.sh

So moving it for CAPV to go would still leave the cloud provider on the old script.

chrischdi avatar Aug 24 '23 09:08 chrischdi

I think they can probably copy&paste what we do. Basically they do almost the same as we do in e2e tests (they use the CAPI test framework with clusterctl, etc.)

sbueringer avatar Aug 24 '23 10:08 sbueringer

CPI should really be using a kubetest2 implementation so they can walk the latest recommended builds of everything, like https://github.com/kubernetes-sigs/provider-aws-test-infra/tree/main/kubetest2-ec2

randomvariable avatar Aug 25 '23 15:08 randomvariable

Note: IPAM for CI moved to Go in capv and is not anymore inside the e2e.sh script :-)

chrischdi avatar Feb 20 '24 11:02 chrischdi