-
Notifications
You must be signed in to change notification settings - Fork 531
test: add test to validate the controller actions to keep the cluster data #1212
test: add test to validate the controller actions to keep the cluster data #1212
Conversation
the judgement of clusterChanged is wrong
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hectorj2f 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 |
e49807d
to
bba163b
Compare
Eventually(func() bool { | ||
_, found = cc.clusterDataMap[kc.Name] | ||
return found | ||
}, 30*time.Second).Should(BeTrue()) |
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.
Recommend: Verify that the data updated (API Endpoint) equals what is updated above?
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.
👍
@hectorj2f Thanks for doing this. The test itself looks quite allright. A few nits (see comments). Additionally little bit of history for your reference: Having said that, I do agree that the current test is not verifying the cluster state change and I think its ok to introduce the new test you have added, covering the missing piece as here (It would be worse in terms of time consumed to verify this scenario in e2e). |
@irfanurrehman I'd check how this can all be introduced without causing a lot of confusion or messing up the code structure. I certainly realized that there are many pieces of the kubefed's code that are not tested either because it escapes from the e2e radar or it is too complex to create mocks for all these tess. |
bba163b
to
2fbc981
Compare
@irfanurrehman I addressed your comments. I didn't move the new test to |
Thanks @hectorj2f |
What this PR does / why we need it:
It is a continuation of #1201 which has been stale for a long period. I cherry picked their changes and added some tests.
This test also cover other functions of the kubefedcluster controller.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer: