test(goosefs): migrate suite to Ginkgo v2 and add controller tests#5687
test(goosefs): migrate suite to Ginkgo v2 and add controller tests#5687hxrshxz wants to merge 3 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 |
|
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. |
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 significantly enhances the testing infrastructure for the GooseFS controller. It modernizes the existing test suite by upgrading to Ginkgo v2 and introduces a comprehensive set of new tests to ensure the robustness and correctness of key controller functionalities, including runtime reconciliation, engine management, and CRD interactions. 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
|
There was a problem hiding this comment.
Code Review
This pull request migrates the GooseFS controller test suite to Ginkgo v2 and adds several new tests. The migration in suite_test.go is well-executed. However, I've identified several issues in the newly added test file pkg/controllers/v1alpha1/goosefs/goosefs_runtime_controller_test.go. Some tests are incomplete or do not test the intended functionality, which could lead to a false sense of test coverage. I've provided detailed feedback and code suggestions to address these issues and improve the quality and correctness of the tests.
There was a problem hiding this comment.
Pull request overview
This PR migrates the GooseFS controller test suite under pkg/controllers/v1alpha1/goosefs to Ginkgo v2 and introduces new controller-focused specs (unit-style with fake clients plus an envtest CRUD spec) to improve confidence in the reconciler and runtime helper behaviors.
Changes:
- Updated
suite_test.gofrom Ginkgo v1-styleBeforeSuite(done Done)to Ginkgo v2-styleBeforeSuite(func() { ... })and tightened envtest CRD path handling. - Added a new
goosefs_runtime_controller_test.gofile with Ginkgo/Gomega specs for reconciler construction, controller name, reconcile not-found behavior, runtime lookup, and an envtest CRD CRUD test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/controllers/v1alpha1/goosefs/suite_test.go | Migrates suite bootstrapping to Ginkgo v2 and adds stricter envtest configuration. |
| pkg/controllers/v1alpha1/goosefs/goosefs_runtime_controller_test.go | Adds new reconciler/controller tests (fake client + envtest CRUD). |
💡 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.
|
/gemini review |
1 similar comment
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request successfully migrates the test suite to Ginkgo v2 and introduces a comprehensive set of new controller tests for the GooseFSRuntime. The new tests cover various aspects of the reconciler, including initialization, controller naming, reconciliation logic for existing and non-existent runtimes, engine creation/removal, and CRD CRUD operations via envtest. The migration to Ginkgo v2 syntax is correctly applied across the suite_test.go file. However, one test case lacks a proper assertion, which reduces its effectiveness.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5687 +/- ##
==========================================
+ Coverage 61.21% 61.22% +0.01%
==========================================
Files 444 444
Lines 30540 30557 +17
==========================================
+ Hits 18694 18710 +16
- Misses 10306 10307 +1
Partials 1540 1540 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request successfully migrates the GooseFS controller test suite to Ginkgo v2 and expands test coverage with new, well-written specs. The migration is clean and follows best practices for Ginkgo v2. I have one suggestion to enhance the clarity of a test case by making its assertion more explicit, which will improve maintainability.
Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: Harsh <harshmastic@gmail.com>
a98224a to
cad9cfa
Compare
Signed-off-by: Harsh <harshmastic@gmail.com>
|



Ⅰ. Describe what this PR does
Migrates pkg/controllers/v1alpha1/goosefs from Ginkgo v1 syntax to Ginkgo v2 and adds 10 Ginkgo/Gomega specs covering NewRuntimeReconciler, ControllerName, Reconcile, getRuntime, GetOrCreateEngine, and an envtest CRD CRUD test.
Ⅱ. Does this pull request fix one issue?
#5676
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
N/A