Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/ddc/alluxio/ufs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,16 @@ var _ = Describe("AlluxioEngine UFS related tests", func() {
})
})

// 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.
Comment on lines +388 to +397
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.

func mockExecCommandInContainerForTotalStorageBytes() (stdout string, stderr string, err error) {
r := `File Count Folder Count Folder Size
50000 1000 6706560319`
Expand Down
Loading