Skip to content

This PR is to add comments to mockExecCommandInContainerForTotalStorageBytes in pkg/ddc/alluxio/ufs_test.go#5815

Open
camellia-sad wants to merge 1 commit intofluid-cloudnative:masterfrom
camellia-sad:lzk
Open

This PR is to add comments to mockExecCommandInContainerForTotalStorageBytes in pkg/ddc/alluxio/ufs_test.go#5815
camellia-sad wants to merge 1 commit intofluid-cloudnative:masterfrom
camellia-sad:lzk

Conversation

@camellia-sad
Copy link
Copy Markdown

Ⅰ. Describe what this PR does

Add comments to mockExecCommandInContainerForTotalStorageBytes in pkg/ddc/alluxio/ufs_test.go

Ⅱ. Does this pull request fix one issue?

fixes #5814

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Apr 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 cheyang for approval by writing /assign @cheyang 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 Apr 28, 2026

Hi @camellia-sad. 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

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 adds documentation to the mockExecCommandInContainerForTotalStorageBytes function in the Alluxio UFS tests. Feedback was provided to correct a technical inaccuracy regarding the command being mocked and to adjust the documentation style to follow Go idioms more closely.

Comment on lines +388 to +397
// mockExecCommandInContainerForTotalStorageBytes mocks command execution output for total storage bytes.
// This helper returns a fixed stdout payload that mimics the "du"-style summary used by tests.
//
// Parameters:
// - none
//
// Returns:
// - stdout (string): Mocked command output including file count, folder count, and folder size.
// - stderr (string): Empty string because this mock simulates successful execution.
// - err (error): Always nil for the success-path test scenario.
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.

medium

The added documentation contains a technical inaccuracy and follows a non-idiomatic style for Go.

  1. Technical Inaccuracy: The comment describes the payload as mimicking a "du"-style summary. However, the mocked output format (File Count, Folder Count, Folder Size) corresponds to the alluxio fs count command, not du.
  2. Documentation Style: The use of explicit "Parameters" and "Returns" sections is not standard in Go doc comments. These should be simplified into concise prose as per Go conventions.
Suggested change
// mockExecCommandInContainerForTotalStorageBytes mocks command execution output for total storage bytes.
// This helper returns a fixed stdout payload that mimics the "du"-style summary used by tests.
//
// Parameters:
// - none
//
// Returns:
// - stdout (string): Mocked command output including file count, folder count, and folder size.
// - stderr (string): Empty string because this mock simulates successful execution.
// - err (error): Always nil for the success-path test scenario.
// mockExecCommandInContainerForTotalStorageBytes mocks command execution output for total storage bytes.
//
// This helper returns a fixed stdout payload that mimics the "count" summary used by tests.
// It returns a mocked stdout string containing file count, folder count, and folder size,
// along with an empty stderr and a nil error.

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Apr 28, 2026

/ok-to-test

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Apr 28, 2026

Hi @camellia-sad, thanks for your contribution! The DCO check is failing. Please ensure each commit has a Signed-off-by line matching the commit author. You can fix this with git commit --amend -s. See https://probot.github.io/apps/dco/ for details.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.17%. Comparing base (b2263fb) to head (b374ebd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5815   +/-   ##
=======================================
  Coverage   58.17%   58.17%           
=======================================
  Files         478      478           
  Lines       32477    32477           
=======================================
  Hits        18894    18894           
  Misses      12040    12040           
  Partials     1543     1543           

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

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.

Add comments to mockExecCommandInContainerForTotalStorageBytes in pkg/ddc/alluxio/ufs_test.go

2 participants