test(controllers): migrate core pkg/controllers tests to Ginkgo#5679
test(controllers): migrate core pkg/controllers tests to Ginkgo#5679hxrshxz wants to merge 7 commits intofluid-cloudnative:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request modernizes the testing infrastructure for the core controller logic by adopting the Ginkgo testing framework. This change aims to improve the maintainability, expressiveness, and consistency of the controller tests. By focusing solely on the core Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Hi @hxrshxz. Thanks for your PR. I'm waiting for a fluid-cloudnative 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. DetailsInstructions 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. |
There was a problem hiding this comment.
Code Review
This pull request migrates core pkg/controllers tests to Ginkgo, significantly improving test coverage and readability. The new tests cover various aspects of the controllers, including rate limiting, client creation, engine caching, and reconciliation logic. The use of parameterized tests with DescribeTable is a good practice for reducing test code duplication.
Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: Harsh <harshmastic@gmail.com>
4751f6b to
69d2cd0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5679 +/- ##
==========================================
+ Coverage 61.04% 61.21% +0.16%
==========================================
Files 444 444
Lines 30540 30540
==========================================
+ Hits 18643 18694 +51
+ Misses 10360 10306 -54
- Partials 1537 1540 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Migrates core pkg/controllers unit tests from the standard testing style to Ginkgo/Gomega while intentionally excluding runtime-specific coverage to keep scope focused.
Changes:
- Added a Ginkgo suite bootstrap for
pkg/controllers. - Ported controller/manager and operation controller tests to Ginkgo/Gomega.
- Introduced a small fake engine implementation to support controller tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| pkg/controllers/suite_test.go | Adds Ginkgo suite entrypoint for the controllers package. |
| pkg/controllers/operation_controller_test.go | Adds Ginkgo-based tests for OperationReconciler behaviors and helpers. |
| pkg/controllers/manager_test.go | Adds Ginkgo-based tests for manager helper functions and rate limiter behavior. |
| pkg/controllers/fake_engine_core_test.go | Adds a fake engine implementation used by controller tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: Harsh <harshmastic@gmail.com>
2cc8621 to
13b970e
Compare
Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: Harsh <harshmastic@gmail.com>
|



I. Describe what this PR does
This PR migrates core
pkg/controllerstests to Ginkgo and keeps runtime-specific coverage out of this change to keep review scope focused.II. Does this pull request fix one issue?
#5676
III. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Converted/covered core controller tests in:
pkg/controllers/manager_test.gopkg/controllers/operation_controller_test.gopkg/controllers/suite_test.gopkg/controllers/fake_engine_core_test.goIV. Describe how to verify it
Run:
go test ./pkg/controllers/V. Special notes for reviews
N/A