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
8 changes: 8 additions & 0 deletions pkg/ddc/alluxio/operations/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,14 @@ func TestAlluxioFileUtils_Ready(t *testing.T) {
}
}

// TestAlluxioFIleUtils_Du tests the Du method of AlluxioFileUtils.

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.

Just a small consistency suggestion: the surrounding test docs in this file (for example TestAlluxioFileUtils_Count immediately below) use a 'Test cases' bullet list rather than a 'Parameters / Returns' layout. If you'd like the file to read uniformly, you could mirror that pattern here by listing the two scenarios this test covers (exec error path and the successful Du parsing of file size, cached size, and cached percentage). Purely a readability nit, feel free to ignore.

// It verifies that the method returns an error when command execution fails
// and correctly parses the file size, cached size, and cached percentage
// when the command succeeds.
//
// Test cases:
// - command execution returns an error
// - command execution succeeds and du output is parsed correctly
func TestAlluxioFIleUtils_Du(t *testing.T) {
ExecCommon := func(a AlluxioFileUtils, command []string, verbose bool) (stdout string, stderr string, err error) {
return "File Size In Alluxio Path\n577575561 0 (0%) /hbase", "", nil
Expand Down