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

🌱 Add initial clusterclass integration test #5337

Conversation

killianmuldoon
Copy link
Contributor

@killianmuldoon killianmuldoon commented Sep 27, 2021

This PR adds a quickstart style integration test for clusterClass to the topology package. The test includes a number of helper functions that assert certain changes in the cluster which can be used for other integration tests.

Signed-off-by: killianmuldoon kmuldoon@vmware.com

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 27, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 27, 2021
@killianmuldoon killianmuldoon force-pushed the pr-clusterclass-integration-tests branch 2 times, most recently from 5bdb963 to 9a4a71d Compare September 28, 2021 14:22
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 28, 2021
@killianmuldoon killianmuldoon force-pushed the pr-clusterclass-integration-tests branch 3 times, most recently from d921750 to 8fbed2f Compare September 28, 2021 15:26
@killianmuldoon killianmuldoon changed the title 🌱 [WIP] Add initial clusterclass integration test 🌱 Add initial clusterclass integration test Sep 28, 2021
@killianmuldoon killianmuldoon changed the title 🌱 Add initial clusterclass integration test 🌱 [WIPP]Add initial clusterclass integration test Sep 28, 2021
@killianmuldoon killianmuldoon changed the title 🌱 [WIPP]Add initial clusterclass integration test 🌱 [WIP] Add initial clusterclass integration test Sep 28, 2021
@killianmuldoon killianmuldoon changed the title 🌱 [WIP] Add initial clusterclass integration test 🌱 Add initial clusterclass integration test Sep 28, 2021
@enxebre
Copy link
Member

enxebre commented Sep 29, 2021

thanks for adding this @killianmuldoon, I just did a first pass review.

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@killianmuldoon a couple of nits, but I really like how you managed to keep code readable for such a complex test.
This is definitely a great start

internal/builder/builders.go Outdated Show resolved Hide resolved
internal/builder/builders.go Outdated Show resolved Hide resolved
class string
workers *clusterv1.WorkersTopology
version string
controlPlaneReplicas int32
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we should make it a nested builder, given that we are exploding all nested struct as we move on..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - the nested builders are becoming more of a clear necessity. I think I'm going to elide the issue here and open up a specific issue covering nested builders.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue for this opened at: #5378

internal/builder/builders.go Outdated Show resolved Hide resolved
internal/builder/builders.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

In general I like the current implementation. My main concern is the combination of just returning true/false and log statements. I think it would be easier to debug if we would just return an error in cases the assertions fail.

internal/builder/builders.go Outdated Show resolved Hide resolved
internal/builder/builders.go Outdated Show resolved Hide resolved
internal/builder/builders.go Show resolved Hide resolved
controllers/topology/suite_test.go Outdated Show resolved Hide resolved
controllers/topology/suite_test.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
controllers/topology/cluster_controller_test.go Outdated Show resolved Hide resolved
@killianmuldoon killianmuldoon force-pushed the pr-clusterclass-integration-tests branch 2 times, most recently from 38eedf8 to 39ef2bd Compare September 30, 2021 12:04
@sbueringer
Copy link
Member

sbueringer commented Oct 1, 2021

Thx, looks good, one last nit from my side. Can you please resolve the non-controversial and fixed conversations above, so we get a clear picture if there are open discussion points? (mine should be all fine except the new one, I "thumps up'ed" accordingly.)

@sbueringer
Copy link
Member

lgtm +/- #5337 (comment)

@fabriziopandini
Copy link
Member

/lgtm
given that pending comment is not blocking and we have an issue to iterate on it

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2021
@sbueringer
Copy link
Member

/lgtm

Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@killianmuldoon killianmuldoon force-pushed the pr-clusterclass-integration-tests branch from 39ef2bd to ce35ea6 Compare October 5, 2021 10:21
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2021
@killianmuldoon
Copy link
Contributor Author

Rebased and squashed.

@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2021
@fabriziopandini
Copy link
Member

/lgtm
wondering if we should wait till the release is cut for merging this PR 🤔

@sbueringer
Copy link
Member

sbueringer commented Oct 5, 2021

/lgtm wondering if we should wait till the release is cut for merging this PR 🤔

As it's test code I suppose it doesn't make a difference when we merge it either way.

@fabriziopandini
Copy link
Member

/hold
until v1beta1 is cut tomorrow

@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 Oct 5, 2021
@killianmuldoon
Copy link
Contributor Author

@fabriziopandini Is this ready for merge now?

@fabriziopandini
Copy link
Member

/hold cancel
/approve

@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 Oct 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Oct 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit 2110151 into kubernetes-sigs:main Oct 12, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Oct 12, 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants