test: cover juicefs engine with Ginkgo#5819
test: cover juicefs engine with Ginkgo#5819hxrshxz wants to merge 1 commit intofluid-cloudnative:masterfrom
Conversation
Signed-off-by: Harsh <harshmastic@gmail.com>
|
[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.
Pull request overview
This PR advances the repository-wide Ginkgo v2/Gomega migration by adding focused specs for the JuiceFS engine and stabilizing an existing shutdown unit test by seeding required fake runtime objects.
Changes:
- Migrated
pkg/ddc/juicefs/engine_test.gofromtesting/testify-style checks to Ginkgo v2 + Gomega specs coveringBuildandPrecheck. - Fixed
TestDestroyWorkervalidation/setup by adding fakeJuiceFSRuntimeobjects to the fake client input set.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/ddc/juicefs/engine_test.go | Adds Ginkgo/Gomega coverage for Build and Precheck behaviors and error paths. |
| pkg/ddc/juicefs/shutdown_test.go | Seeds required JuiceFSRuntime objects so destroyWorkers() can load runtime metadata during tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request refactors the JuiceFS engine tests to use the Ginkgo and Gomega frameworks, adding comprehensive test cases for the Build and Precheck functions. It also updates the worker destruction tests to include JuiceFSRuntime objects in the fake client. A suggestion was made to simplify the initialization of these runtime objects in the test suite to enhance code readability.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5819 +/- ##
==========================================
+ Coverage 58.89% 58.91% +0.01%
==========================================
Files 479 479
Lines 32443 32443
==========================================
+ Hits 19107 19113 +6
+ Misses 11784 11779 -5
+ Partials 1552 1551 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cheyang
left a comment
There was a problem hiding this comment.
感谢贡献!JuiceFS engine 测试迁移简洁。请确认:
- 旧测试中 runtime2(name="test")的 Build 场景在新测试中有覆盖。
- 当前新增覆盖比旧测试少(+151 vs -108),是否有旧场景被遗漏?如果有遗漏请补充。
cheyang
left a comment
There was a problem hiding this comment.
感谢贡献!JuiceFS engine 测试迁移简洁。请确认:
- 旧测试中 runtime2(name="test")的 Build 场景在新测试中有覆盖。
- 当前新增覆盖比旧测试少(+151 vs -108),是否有旧场景被遗漏?如果有遗漏请补充。
|
感谢贡献!JuiceFS engine 测试迁移简洁。请确认:
|



Ⅰ. Describe what this PR does
Add Ginkgo v2 + Gomega coverage for
pkg/ddc/juicefs/engine.goand fix the package-localshutdown_test.govalidation blocker by seeding the required fakeJuiceFSRuntimeobjects.Ⅱ. 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.
BuildandPrecheck.TestDestroyWorkerpasses in package-wide runs without changing production code.Ⅳ. Describe how to verify it
make fmtgo test ./pkg/ddc/juicefs/... -count=1go test -coverprofile=/tmp/fluid-requested-package.cover ./pkg/ddc/juicefs/... -count=1go tool cover -func=/tmp/fluid-requested-package.cover-> total79.7%rg 'testify' pkg/ddc/juicefs/engine_test.go pkg/ddc/juicefs/shutdown_test.goⅤ. Special notes for reviews
N/A