-
Notifications
You must be signed in to change notification settings - Fork 1.1k
test(jindo): migrate worker_test.go to Ginkgo/Gomega #5628
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
base: master
Are you sure you want to change the base?
test(jindo): migrate worker_test.go to Ginkgo/Gomega #5628
Conversation
- Convert 5 test functions to Ginkgo Describe/DescribeTable format - Fix jindo_suite_test.go package name from jindo_test to jindo - Use testScheme from shutdown_test.go - TestDestroyWorker failure is pre-existing (unrelated) Signed-off-by: Harsh <harshmastic@gmail.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
[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. |
|
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.
Pull request overview
This PR migrates the pkg/ddc/jindo/worker_test.go file from standard Go testing to the Ginkgo/Gomega testing framework, supporting the broader effort to standardize testing across the Fluid codebase.
Changes:
- Converted 5 test functions to Ginkgo's BDD-style
Describe/DescribeTableformat with proper test organization - Fixed
jindo_suite_test.gopackage name fromjindo_testtojindofor consistency with the main package - Reduced test file size from 777 to 612 lines (~21% reduction) through more concise table-driven test syntax
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/ddc/jindo/worker_test.go | Migrated all worker-related tests to Ginkgo/Gomega framework using Describe blocks and DescribeTable for parameterized tests |
| pkg/ddc/jindo/jindo_suite_test.go | Changed package declaration from jindo_test to jindo to match package under test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Spec: datav1alpha1.DatasetSpec{PlacementMode: datav1alpha1.ExclusiveMode}, | ||
| }) | ||
|
|
||
| // runtimeInfoHadoop tests create worker in shareMode mode. |
Copilot
AI
Jan 29, 2026
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.
The comment has a redundant word "mode". It should read "runtimeInfoHadoop tests create worker in share mode" instead of "shareMode mode".
| // runtimeInfoHadoop tests create worker in shareMode mode. | |
| // runtimeInfoHadoop tests create worker in share mode. |
| DescribeTable("should set up workers correctly", | ||
| func(testName string, replicas int32, nodeInputs []*v1.Node, worker *appsv1.StatefulSet, | ||
| testRuntime *datav1alpha1.JindoRuntime, runtimeInfoGetter func() base.RuntimeInfoInterface, | ||
| name, namespace string, deprecated bool) { |
Copilot
AI
Jan 29, 2026
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.
The testName parameter is declared but never used in the test function. Consider removing this unused parameter from the function signature.
| name, namespace string, deprecated bool) { | |
| name, namespace string, deprecated bool) { | |
| By(testName) |
| if !deprecated { | ||
| Expect(*worker.Spec.Replicas).To(Equal(replicas)) | ||
| } |
Copilot
AI
Jan 29, 2026
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.
The deprecated parameter is always passed as false in all test entries, making the conditional check on lines 106-108 dead code. Consider removing both the deprecated parameter and the conditional check, or add a test case with deprecated=true if this functionality still needs to be tested.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5628 +/- ##
=======================================
Coverage 59.22% 59.22%
=======================================
Files 444 444
Lines 30431 30431
=======================================
Hits 18024 18024
Misses 10912 10912
Partials 1495 1495 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Ⅰ. Describe what this PR does
pkg/ddc/jindo/worker_test.gofrom standard Go testing to the Ginkgo/Gomega framework.Describe/DescribeTableformat, fixes thejindo_suite_test.gopackage name, and uses the existingtestSchemefromshutdown_test.go.Ⅱ. Does this pull request fix one issue?
part of #5407
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
No new test cases added. All existing tests were migrated to Ginkgo/Gomega format.
Ⅳ. Describe how to verify it