From e009c22431c44438304d8e258519a797260884cb Mon Sep 17 00:00:00 2001 From: Ksmille <2686097155@qq.com> Date: Wed, 17 Jun 2026 20:21:39 +0800 Subject: [PATCH 1/2] Add comments to TestAlluxioFIleUtils_Du in fluid/pkg/ddc/alluxio/operations/base_test.go. Signed-off-by: Ksmille <2686097155@qq.com> --- pkg/ddc/alluxio/operations/base_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/ddc/alluxio/operations/base_test.go b/pkg/ddc/alluxio/operations/base_test.go index dc1b3c3f69b..edd4200ca74 100644 --- a/pkg/ddc/alluxio/operations/base_test.go +++ b/pkg/ddc/alluxio/operations/base_test.go @@ -479,6 +479,16 @@ func TestAlluxioFileUtils_Ready(t *testing.T) { } } +// TestAlluxioFIleUtils_Du tests the Du method of AlluxioFileUtils. +// This function verifies that the Du method returns an error when the underlying +// command execution fails, and correctly parses the file size, cached size, +// and cached percentage when the command succeeds. +// +// Parameters: +// - t (*testing.T): The testing object used to report test failures. +// +// Returns: +// - None: This test reports failures through the testing object. 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 From bb7444ae497153790507ca440ec3aa7f6e411103 Mon Sep 17 00:00:00 2001 From: Ksmille <2686097155@qq.com> Date: Thu, 18 Jun 2026 15:48:38 +0800 Subject: [PATCH 2/2] Refine comments for TestAlluxioFIleUtils_Du in fluid/pkg/ddc/alluxio/operations/base_test.go. Signed-off-by: Ksmille <2686097155@qq.com> --- pkg/ddc/alluxio/operations/base_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/ddc/alluxio/operations/base_test.go b/pkg/ddc/alluxio/operations/base_test.go index edd4200ca74..1f3fd4ed795 100644 --- a/pkg/ddc/alluxio/operations/base_test.go +++ b/pkg/ddc/alluxio/operations/base_test.go @@ -480,15 +480,13 @@ func TestAlluxioFileUtils_Ready(t *testing.T) { } // TestAlluxioFIleUtils_Du tests the Du method of AlluxioFileUtils. -// This function verifies that the Du method returns an error when the underlying -// command execution fails, and correctly parses the file size, cached size, -// and cached percentage when the command succeeds. +// 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. // -// Parameters: -// - t (*testing.T): The testing object used to report test failures. -// -// Returns: -// - None: This test reports failures through the testing object. +// 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