Skip to content

test: cover juicefs engine with Ginkgo#5819

Merged
fluid-e2e-bot[bot] merged 2 commits into
fluid-cloudnative:masterfrom
hxrshxz:test/juicefs-engine-ginkgo
May 14, 2026
Merged

test: cover juicefs engine with Ginkgo#5819
fluid-e2e-bot[bot] merged 2 commits into
fluid-cloudnative:masterfrom
hxrshxz:test/juicefs-engine-ginkgo

Conversation

@hxrshxz

@hxrshxz hxrshxz commented May 2, 2026

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR does

Add Ginkgo v2 + Gomega coverage for pkg/ddc/juicefs/engine.go and fix the package-local shutdown_test.go validation blocker by seeding the required fake JuiceFSRuntime objects.

Ⅱ. 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.

  • Added focused engine specs for Build and Precheck.
  • Fixed package validation so TestDestroyWorker passes in package-wide runs without changing production code.

Ⅳ. Describe how to verify it

  • make fmt
  • go test ./pkg/ddc/juicefs/... -count=1
  • go test -coverprofile=/tmp/fluid-requested-package.cover ./pkg/ddc/juicefs/... -count=1
  • go tool cover -func=/tmp/fluid-requested-package.cover -> total 79.7%
  • rg 'testify' pkg/ddc/juicefs/engine_test.go pkg/ddc/juicefs/shutdown_test.go

Ⅴ. Special notes for reviews

N/A

@fluid-e2e-bot

fluid-e2e-bot Bot commented May 2, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.go from testing/testify-style checks to Ginkgo v2 + Gomega specs covering Build and Precheck.
  • Fixed TestDestroyWorker validation/setup by adding fake JuiceFSRuntime objects 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/ddc/juicefs/shutdown_test.go
@codecov

codecov Bot commented May 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.11%. Comparing base (d14dcc7) to head (a94ca8e).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5819      +/-   ##
==========================================
+ Coverage   59.10%   59.11%   +0.01%     
==========================================
  Files         480      480              
  Lines       32512    32512              
==========================================
+ Hits        19215    19221       +6     
+ Misses      11747    11742       -5     
+ Partials     1550     1549       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cheyang cheyang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢贡献!JuiceFS engine 测试迁移简洁。请确认:

  1. 旧测试中 runtime2(name="test")的 Build 场景在新测试中有覆盖。
  2. 当前新增覆盖比旧测试少(+151 vs -108),是否有旧场景被遗漏?如果有遗漏请补充。

@cheyang cheyang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢贡献!JuiceFS engine 测试迁移简洁。请确认:

  1. 旧测试中 runtime2(name="test")的 Build 场景在新测试中有覆盖。
  2. 当前新增覆盖比旧测试少(+151 vs -108),是否有旧场景被遗漏?如果有遗漏请补充。

@cheyang

This comment has been minimized.

@cheyang

cheyang commented May 8, 2026

Copy link
Copy Markdown
Collaborator

English translation of the previous review comments:

  1. Please confirm that the Build scenario for runtime2 (name="test") from the old tests is covered in the new Ginkgo tests.
  2. The new coverage appears to be less than the old tests (+151 vs -108). Are any old scenarios missing? If so, please add them.

hxrshxz added 2 commits May 11, 2026 06:43
Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: Harsh <harshmastic@gmail.com>
@hxrshxz hxrshxz force-pushed the test/juicefs-engine-ginkgo branch from ca0fd1a to a94ca8e Compare May 11, 2026 01:14
@sonarqubecloud

Copy link
Copy Markdown

@hxrshxz

hxrshxz commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

Restored coverage for the old runtime2 (name="test") Build scenario in the new Ginkgo tests.

I also rechecked the removed old engine tests against the new specs; no old Build/Precheck scenario is intentionally dropped.

@cheyang cheyang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@fluid-e2e-bot

fluid-e2e-bot Bot commented May 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fluid-e2e-bot fluid-e2e-bot Bot merged commit d534f2a into fluid-cloudnative:master May 14, 2026
18 checks passed
@cheyang

cheyang commented May 14, 2026

Copy link
Copy Markdown
Collaborator

/approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants