Skip to content

Conversation

@hxrshxz
Copy link
Contributor

@hxrshxz hxrshxz commented Jan 28, 2026

Ⅰ. Describe what this PR does

Migrate unit tests in pkg/ddc/goosefs/node_test.go to use Ginkgo/Gomega.

Ⅱ. Does this pull request fix one issue?

part of #5407

Ⅲ. List the added test cases

No new test cases. Migrated existing tests to Ginkgo/Gomega.

Ⅳ. Describe how to verify it

go test -v ./pkg/ddc/goosefs/... -count=1

Ⅴ. Special notes for reviews

N/A

Signed-off-by: Harsh <harshmastic@gmail.com>
Copilot AI review requested due to automatic review settings January 28, 2026 05:15
@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Jan 28, 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 trafalgarzzz for approval by writing /assign @trafalgarzzz 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

fluid-e2e-bot bot commented Jan 28, 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.

Copy link
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 migrates the unit tests in pkg/ddc/goosefs/node_test.go from the traditional Go testing framework to Ginkgo/Gomega as part of the broader initiative (#5407) to modernize Fluid's testing framework and improve code quality.

Changes:

  • Replaced testing import with Ginkgo/Gomega imports
  • Converted table-driven test TestSyncScheduleInfoToCacheNodes to use Ginkgo's DescribeTable pattern
  • Renamed runtime import to runtimeschema to avoid naming conflicts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.30%. Comparing base (77d4cb2) to head (1eb3569).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5545   +/-   ##
=======================================
  Coverage   61.30%   61.30%           
=======================================
  Files         444      444           
  Lines       30540    30540           
=======================================
  Hits        18723    18723           
  Misses      10275    10275           
  Partials     1542     1542           

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

@hxrshxz hxrshxz marked this pull request as draft January 28, 2026 09:10
Signed-off-by: Harsh <harshmastic@gmail.com>
@hxrshxz hxrshxz marked this pull request as ready for review February 6, 2026 19:15
@hxrshxz hxrshxz requested a review from Copilot February 6, 2026 19:16
Copy link
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Harsh <harshmastic@gmail.com>
@hxrshxz hxrshxz force-pushed the ginkgo/goosefs-node branch 2 times, most recently from c03a506 to f7a9ae4 Compare February 7, 2026 05:24
The test assertion should verify the runtime-specific label rather than
the common label to accurately validate SyncScheduleInfoToCacheNodes
behavior. This ensures nodes with worker pods get the correct
runtime-specific label (e.g., fluid.io/s-goosefs-default-hbase) rather
than just checking for the common label which might exist from other
sources.

Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: Harsh <harshmastic@gmail.com>
@hxrshxz hxrshxz force-pushed the ginkgo/goosefs-node branch from 902ba32 to 1eb3569 Compare February 9, 2026 12:51
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

@cheyang
Copy link
Collaborator

cheyang commented Feb 10, 2026

/gemini review

Copy link
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 successfully migrates the node tests in pkg/ddc/goosefs/node_test.go to use Ginkgo and Gomega. The refactoring improves test structure and isolation by using DescribeTable and creating a new client for each test case. This is a good improvement for test reliability and readability. I have one suggestion to further align with Go's best practices regarding context usage in tests.

datasetLabels, err := labels.Parse(fmt.Sprintf(testNodeLabelSelector, engine.runtimeInfo.GetCommonLabelName()))
Expect(err).NotTo(HaveOccurred())

err = c.List(context.TODO(), nodeList, &client.ListOptions{
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For clarity and adherence to best practices, it's recommended to use context.Background() as the root context in tests instead of context.TODO(). The Go documentation specifies that context.Background() is typically used by the main function, initialization, and tests.

Suggested change
err = c.List(context.TODO(), nodeList, &client.ListOptions{
err = c.List(context.Background(), nodeList, &client.ListOptions{

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.

2 participants