From b72b170c73bbc07082324f08cefce9a360611dfe Mon Sep 17 00:00:00 2001 From: 0112Han <15829229836@163.com> Date: Wed, 5 Mar 2025 19:23:30 +0800 Subject: [PATCH 1/2] Add comments to Test_parseFSInfoFromConfigMap in pkg/ddc/juicefs/datasetinfo_parser_test.go Signed-off-by: 0112Han <15829229836@163.com> --- pkg/ddc/juicefs/datasetinfo_parser_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/ddc/juicefs/datasetinfo_parser_test.go b/pkg/ddc/juicefs/datasetinfo_parser_test.go index dd7f4209a8f..9c5965f84d7 100644 --- a/pkg/ddc/juicefs/datasetinfo_parser_test.go +++ b/pkg/ddc/juicefs/datasetinfo_parser_test.go @@ -168,7 +168,16 @@ func TestGetFSInfoFromConfigMap(t *testing.T) { } } } - +// Test_parseFSInfoFromConfigMap is a unit test function for the parseFSInfoFromConfigMap method. +// It validates whether the function correctly extracts and parses dataset information +// from a given Kubernetes ConfigMap. +// +// Steps: +// 1. Define test cases with different ConfigMap data inputs. +// 2. Execute parseFSInfoFromConfigMap using the provided test cases. +// 3. Verify the returned metadata information against expected values. +// 4. Check for expected errors in erroneous cases. +// 5. Use assertions to ensure the function behaves as intended. func Test_parseFSInfoFromConfigMap(t *testing.T) { type args struct { configMap *v1.ConfigMap From ec87aa8b786177b602806c929f9a05ff8143958b Mon Sep 17 00:00:00 2001 From: 0112Han <15829229836@163.com> Date: Fri, 7 Mar 2025 10:58:19 +0800 Subject: [PATCH 2/2] Fix code style: add blank line between functions Signed-off-by: 0112Han <15829229836@163.com> --- pkg/ddc/juicefs/datasetinfo_parser_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/ddc/juicefs/datasetinfo_parser_test.go b/pkg/ddc/juicefs/datasetinfo_parser_test.go index 9c5965f84d7..13973de3555 100644 --- a/pkg/ddc/juicefs/datasetinfo_parser_test.go +++ b/pkg/ddc/juicefs/datasetinfo_parser_test.go @@ -168,6 +168,7 @@ func TestGetFSInfoFromConfigMap(t *testing.T) { } } } + // Test_parseFSInfoFromConfigMap is a unit test function for the parseFSInfoFromConfigMap method. // It validates whether the function correctly extracts and parses dataset information // from a given Kubernetes ConfigMap.