-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve controller test #44
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Because they are used by tests for controllers, move them under the controller directory. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
All tests can use the common SC, use it to make them simple. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
All tests should use unique PVs and PVCs, so generate unique names in the new helper function. The old helper may use in the future, it remains but becomes private. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
All tests should use unique names to ensure independence. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
toshipp
force-pushed
the
improve-controller-test
branch
from
October 1, 2024 02:23
25d5258
to
cdcc950
Compare
I'll rebase it after the review. |
satoru-takeuchi
approved these changes
Oct 2, 2024
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.
LGTM. Could you squash commits?
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Ginkgo provides contexts for its containers. Using it, we can handle test termination gracefully. Note that NewManagerUtil requires a context not bounded to a container, so use context.Background. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Because the reconciler uses FieldIndexer, it should use a cache client. If not, List method fails, it finally causes no Reconcile method invocation when CronJob is deleted. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
The real environment, reconcilers use the cache client from the manager. Being closer, use it on tests. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
deleteRestoringPVC and deleteRestoringPV returns an error if the PV or PVC still exists, we should retry them until they succeed. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
toshipp
force-pushed
the
improve-controller-test
branch
from
October 2, 2024 10:03
3a69732
to
bb94cff
Compare
satoru-takeuchi
approved these changes
Oct 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
see commit messages.