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

// TestAlluxioFIleUtils_MKdir verifies AlluxioFileUtils.Mkdir by stubbing the private exec method with gomonkey:
// when exec returns an error, Mkdir should return a non-nil error; when exec succeeds, Mkdir should return nil.
// patches.Reset in defer restores the original behavior after the test.
Comment on lines +239 to +241
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 comment contains non-standard casing (FIleUtils and MKdir). In Go, it is conventional to use CamelCase (FileUtils and Mkdir). Note that the comment is internally inconsistent, as it uses the correct casing Mkdir in the second line but MKdir in the first. To improve maintainability and follow Go style conventions, the documentation (and ideally the function name itself) should be corrected to use standard casing.

Suggested change
// TestAlluxioFIleUtils_MKdir verifies AlluxioFileUtils.Mkdir by stubbing the private exec method with gomonkey:
// when exec returns an error, Mkdir should return a non-nil error; when exec succeeds, Mkdir should return nil.
// patches.Reset in defer restores the original behavior after the test.
// TestAlluxioFileUtils_Mkdir verifies AlluxioFileUtils.Mkdir by stubbing the private exec method with gomonkey:
// when exec returns an error, Mkdir should return a non-nil error; when exec succeeds, Mkdir should return nil.
// patches.Reset in defer restores the original behavior after the test.

func TestAlluxioFIleUtils_MKdir(t *testing.T) {
ExecCommon := func(a AlluxioFileUtils, command []string, verbose bool) (stdout string, stderr string, err error) {
return "alluxio mkdir success", "", nil
Expand Down
Loading