-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This PR is to add comments to TestAlluxioFIlUtils_CleanCache in pkg/ddc/alluxio/operations/cached_test.go #5864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,18 @@ func TestAlluxioFileUtils_CachedState(t *testing.T) { | |
| } | ||
| } | ||
|
|
||
| // TestAlluxioFIlUtils_CleanCache tests the CleanCache function of AlluxioFileUtils. | ||
| // It uses gomonkey to mock the exec function and simulates different scenarios, including command execution failure and successful execution on both Ubuntu and Alpine systems. | ||
| // The test checks if the CleanCache function correctly handles errors and returns the expected results based on the mocked exec function's output. | ||
| // The test cases include: | ||
| // 1. Simulating a command execution failure and verifying that the CleanCache function returns an error. | ||
| // 2. Simulating a successful command execution on an Ubuntu system and verifying that the CleanCache function returns nil (indicating success). | ||
| // 3. Simulating a successful command execution on an Alpine system and verifying that the CleanCache function returns nil (indicating success). | ||
|
|
||
| // parameters: | ||
| // - t: The testing object used to report test failures and log information during the test execution. | ||
| // returns: | ||
| // - None. The function uses the testing object to report results and does not return any value. | ||
|
Comment on lines
+61
to
+65
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Go, documentation comments should be placed immediately before the function declaration without any intervening blank lines. Additionally, documenting standard parameters like References
|
||
| func TestAlluxioFIlUtils_CleanCache(t *testing.T) { | ||
| ExecCommonUbuntu := func(a AlluxioFileUtils, command []string, verbose bool) (stdout string, stderr string, err error) { | ||
| return "Ubuntu", "", nil | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name
TestAlluxioFIlUtils_CleanCachecontains a typo (FIlUtilsinstead ofFileUtils). This typo should be corrected in the function declaration as well as in this documentation comment to maintain consistency with the rest of the codebase (e.g.,TestAlluxioFileUtils_CachedState).References