Skip to content

Commit 2a442cd

Browse files
authored
Add comments to TestCheckRuntimeReady in pkg/ddc/alluxio/load_data_test.go (#4697)
Signed-off-by: StanQAQ <jb6806973@gmail.com>
1 parent 848dfe9 commit 2a442cd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/ddc/alluxio/load_data_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,21 @@ func Test_genDataLoadValue(t *testing.T) {
465465
}
466466
}
467467

468+
// TestCheckRuntimeReady tests the CheckRuntimeReady function of the AlluxioEngine.
469+
// This function verifies whether the Alluxio runtime is ready by mocking the execution of container commands.
470+
// It uses two mock functions:
471+
// 1. mockExecCommon: Simulates a successful command execution.
472+
// 2. mockExecErr: Simulates a failed command execution.
473+
//
474+
// The test cases include:
475+
// 1. A successful runtime check, where the function should return true.
476+
// 2. A failed runtime check, where the function should return false.
477+
//
478+
// Parameters:
479+
// - t (*testing.T): The testing context for logging and error reporting.
480+
//
481+
// Returns:
482+
// - None. The function asserts the expected results and fails the test if the conditions are not met.
468483
func TestCheckRuntimeReady(t *testing.T) {
469484
mockExecCommon := func(ctx context.Context, podName string, containerName string, namespace string, cmd []string) (stdout string, stderr string, e error) {
470485
return "", "", nil

0 commit comments

Comments
 (0)