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

Integrate with CAPI e2e test framework #95

Merged
merged 18 commits into from
Mar 25, 2024
Merged

Integrate with CAPI e2e test framework #95

merged 18 commits into from
Mar 25, 2024

Conversation

nasusoba
Copy link
Contributor

@nasusoba nasusoba commented Mar 14, 2024

As discussed in issue 25, I have init-ed work for e2e. Summary for my work:

  • Add the e2e test under test/e2e ( I mainly followed cluster-api-provider-rke2)
    • Add two simple test specs in test/e2e/e2e_test.go
      • create_test: Create a cluster with 1 controlplane and 3 workers.
      • node_scale_test: Create a cluster with 1 worker node, scale up and down.
    • One thing to notice is that I copied lots of codes from sigs.k8s.io/cluster-api/test/framework/* to test/e2e/helpers.go, because in the original framework, it assumed the use of KubeadmControlPlane, so I just copied code and changed to KThreesControlplane.
  • Change the default tag in config/manager/kustomization.yaml to dev. Add a docker-build-e2e Makefile target for building docker image with tag dev. This image will be used during e2e test.
  • Add test/e2e/README.md for usage

Future work

  • Scaling down control plane is buggy, need to enable scaling down control plane in the e2e test when the bug is fixed.

bootstrap/config/manager/kustomization.yaml Show resolved Hide resolved
By(fmt.Sprintf(format, a...))
}

func setupSpecNamespace(ctx context.Context, specName string, clusterProxy framework.ClusterProxy, artifactFolder string) (*corev1.Namespace, context.CancelFunc) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, why CAPI don't export these e2e test helper methods? Maybe we can ask CAPI guys

test/e2e/config/k3s-docker.yaml Outdated Show resolved Hide resolved
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.6.2/core-components.yaml
type: url
files:
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's try point to github release file as well.

Copy link
Contributor Author

@nasusoba nasusoba Mar 20, 2024

Choose a reason for hiding this comment

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

this is not possible, have added more comment about in shared/v1beta1/metadata.yaml

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, that's fine. Let's update metadata and k3s-docker file regularly to catch up CAPI release.

test/e2e/e2e_test.go Outdated Show resolved Hide resolved
test/e2e/e2e_test.go Outdated Show resolved Hide resolved
test/e2e/e2e_test.go Outdated Show resolved Hide resolved
test/e2e/e2e_test.go Outdated Show resolved Hide resolved
test/e2e/e2e_test.go Outdated Show resolved Hide resolved
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
nasusoba and others added 4 commits March 20, 2024 16:41
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
Signed-off-by: nasusoba <[email protected]>
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.6.2/core-components.yaml
type: url
files:
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, that's fine. Let's update metadata and k3s-docker file regularly to catch up CAPI release.

@mogliang
Copy link
Collaborator

LGTM

@mogliang
Copy link
Collaborator

@richardcase it seems that my approval doesn't unblock the pr review gate?

@richardcase
Copy link
Collaborator

@richardcase it seems that my approval doesn't unblock the pr review gate?

I can get that sorted.

@richardcase
Copy link
Collaborator

@mogliang - you should be good to go now :) Let me know if you have any issues.

@mogliang mogliang merged commit 2f9f571 into k3s-io:main Mar 25, 2024
5 checks passed
@nasusoba nasusoba deleted the e2e branch March 25, 2024 02:51
@nasusoba nasusoba restored the e2e branch March 25, 2024 02:59
@nasusoba nasusoba deleted the e2e branch March 25, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants