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

// TestAlluxioFileUtils_Du tests the Du method of AlluxioFileUtils.
// It verifies the method's ability to parse the output of the alluxio fs du command
// and handle various error scenarios such as execution errors, too many lines,
// data number mismatches, and parse errors.
//
// Test cases:
// - EXEC_ERR: Tests handling of command execution errors.
// - TOO_MANY_LINES: Tests handling of output with too many lines.
// - DATA_NUM: Tests handling of mismatched data numbers.
Comment on lines +88 to +95
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 documentation can be improved for accuracy. The Du method specifically executes the alluxio fs du -s command. Also, the DATA_NUM test case verifies the handling of a mismatched number of fields (columns) in the command output, rather than the values of the data itself.

Suggested change
// It verifies the method's ability to parse the output of the alluxio fs du command
// and handle various error scenarios such as execution errors, too many lines,
// data number mismatches, and parse errors.
//
// Test cases:
// - EXEC_ERR: Tests handling of command execution errors.
// - TOO_MANY_LINES: Tests handling of output with too many lines.
// - DATA_NUM: Tests handling of mismatched data numbers.
// It verifies the method's ability to parse the output of the alluxio fs du -s command
// and handle various error scenarios such as execution errors, too many lines,
// mismatched number of fields, and parse errors.
//
// Test cases:
// - EXEC_ERR: Tests handling of command execution errors.
// - TOO_MANY_LINES: Tests handling of output with too many lines.
// - DATA_NUM: Tests handling of mismatched number of fields.

// - PARSE_ERR: Tests handling of parse errors.
// - FINE: Tests successful parsing of du output.
func TestAlluxioFileUtils_Du(t *testing.T) {
out1, out2, out3 := 111, 222, "%233"
mockExec := func(ctx context.Context, p1, p2, p3 string, p4 []string) (stdout string, stderr string, e error) {
Expand Down
Loading