From 67907521b13ad5c383c4f588eb881ac708c76777 Mon Sep 17 00:00:00 2001 From: poirot <554137585@qq.com> Date: Thu, 22 May 2025 14:55:10 +0800 Subject: [PATCH 1/2] Add comments to TestMountRootWithoutEnvSet in pkg\ddc\alluxio\utils_test.go Signed-off-by: poirot <554137585@qq.com> --- pkg/ddc/alluxio/utils_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/ddc/alluxio/utils_test.go b/pkg/ddc/alluxio/utils_test.go index d6e055100d7..374e8ced482 100644 --- a/pkg/ddc/alluxio/utils_test.go +++ b/pkg/ddc/alluxio/utils_test.go @@ -169,7 +169,11 @@ func TestMountRootWithEnvSet(t *testing.T) { } } } - +// TestMountRootWithoutEnvSet tests that the getMountRoot function returns +// the default mount root path ("/alluxio") when the environment variable +// for mount root is not set. It uses a test case with an input path of +// "/var/lib/mymount" but expects "/alluxio" as the result since the +// environment variable is explicitly unset before calling getMountRoot. func TestMountRootWithoutEnvSet(t *testing.T) { var testCases = []struct { input string From d2cf3dd600ef7c69ea9effd0ff34130c1c7d2cdb Mon Sep 17 00:00:00 2001 From: poirot <554137585@qq.com> Date: Mon, 26 May 2025 10:33:03 +0800 Subject: [PATCH 2/2] Add comments to TestMountRootWithoutEnvSet in pkg\ddc\alluxio\utils_test.go Signed-off-by: poirot <554137585@qq.com> --- pkg/ddc/alluxio/utils_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/ddc/alluxio/utils_test.go b/pkg/ddc/alluxio/utils_test.go index 374e8ced482..6136bc2644e 100644 --- a/pkg/ddc/alluxio/utils_test.go +++ b/pkg/ddc/alluxio/utils_test.go @@ -169,11 +169,11 @@ func TestMountRootWithEnvSet(t *testing.T) { } } } -// TestMountRootWithoutEnvSet tests that the getMountRoot function returns -// the default mount root path ("/alluxio") when the environment variable -// for mount root is not set. It uses a test case with an input path of -// "/var/lib/mymount" but expects "/alluxio" as the result since the -// environment variable is explicitly unset before calling getMountRoot. + +// TestMountRootWithoutEnvSet tests the getMountRoot function when the MountRoot environment variable is not set. +// It verifies that getMountRoot returns the default mount root path "/alluxio" when no environment variable is configured. +// The test unsets the MountRoot environment variable and compares the actual result with the expected default value. + func TestMountRootWithoutEnvSet(t *testing.T) { var testCases = []struct { input string