-
Notifications
You must be signed in to change notification settings - Fork 208
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 tests for gcp_machine_controller #260
Conversation
Hi @nader-ziada. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nader-ziada The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@detiber @wfernandes since you looked at this code, can one of you give this PR an |
/ok-to-test |
I've had a chat with @wfernandes and explained why checking that a func has not been called yet in the test might not guarantee that the required validation happened since all these validation happen in sequence in the same is there anything else I should be changing here? Thanks |
/test pull-cluster-api-provider-gcp-make-conformance |
1 similar comment
/test pull-cluster-api-provider-gcp-make-conformance |
Expect(k8sClient.Delete(ctx, machineScope.GCPMachine)).Should(Succeed()) | ||
}) | ||
|
||
It("should return early if gcp machine is in error state", func() { |
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.
Can we change the test title to better reflect what is being tested? Currently it doesn't seem like we are testing early return. Is there a way to assert that reconciliation hasn't happened? Maybe verifying if ProviderID isn't set. since that is a mandatory step in reconciliation. WDYT?
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'm not sure I understand your point? returning early is just another way of saying reconciliation didn't happen and since there is an error message it also means reconciliation didn't happen
Expect(buf.String()).To(ContainSubstring("Error state detected, skipping reconciliation")) | ||
}) | ||
|
||
It("should return if infrastructure is not ready", func() { |
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.
Same comment as above.
Expect(buf.String()).To(ContainSubstring("Cluster infrastructure is not ready yet")) | ||
}) | ||
|
||
It("should return if bootstrap data is not available", func() { |
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.
Same comment as above.
- create a mock gcp compute service to be able to mock out the calls to gcp in the test - change the controller to allow for passing of the mock service
@vincepri @wfernandes any comments of this PR? I'm not aware of any outstanding changes I should still make. Thanks |
I don't think the failure in the conformance tests are related to the changes in this PR, will investigate further anyways |
/retest |
/test pull-cluster-api-provider-gcp-make-conformance |
@nader-ziada: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/close |
@nader-ziada: Closed this PR. 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. |
What this PR does / why we need it: