Skip to content

test: cover juicefs engine with Ginkgo#5819

Open
hxrshxz wants to merge 1 commit intofluid-cloudnative:masterfrom
hxrshxz:test/juicefs-engine-ginkgo
Open

test: cover juicefs engine with Ginkgo#5819
hxrshxz wants to merge 1 commit intofluid-cloudnative:masterfrom
hxrshxz:test/juicefs-engine-ginkgo

Conversation

@hxrshxz
Copy link
Copy Markdown
Contributor

@hxrshxz hxrshxz commented May 2, 2026

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

Signed-off-by: Harsh <harshmastic@gmail.com>
Copilot AI review requested due to automatic review settings May 2, 2026 16:45
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented May 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zwwhdls for approval by writing /assign @zwwhdls in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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
Copy link
Copy Markdown

fluid-e2e-bot Bot commented May 2, 2026

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.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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.

Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.91%. Comparing base (5bc2c17) to head (0a1545e).

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

Copy link
Copy Markdown
Collaborator

@cheyang cheyang left a comment

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),是否有旧场景被遗漏?如果有遗漏请补充。

Copy link
Copy Markdown
Collaborator

@cheyang cheyang left a comment

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
Copy link
Copy Markdown
Collaborator

cheyang commented May 6, 2026

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

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

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