Skip to content

Commit 5db342d

Browse files
tongyf2333tongyf
andauthored
This PR is to add comments to TestGetFSInfoFromConfigMap in pkg/ddc/juicefs/datasetinfo_parser_test.go (#4773)
* Add comments to Test_parseFSInfoFromConfigMap in pkg/ddc/juicefs/datasetinfo_parser_test.go Signed-off-by: tongyf <tongyf@meow.com> * Add Notation to TestGetFSInfoFromConfigMap in pkg/ddc/juicefs/datasetinfo_parser_test.go Signed-off-by: tongyf <tongyf@meow.com> * Add Notation to TestGetFSInfoFromConfigMap in pkg/ddc/juicefs/datasetinfo_parser_test.go Signed-off-by: tongyf <tongyf@meow.com> --------- Signed-off-by: tongyf <tongyf@meow.com> Co-authored-by: tongyf <tongyf@meow.com>
1 parent 349ebd2 commit 5db342d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

pkg/ddc/juicefs/datasetinfo_parser_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ func Test_parseCacheInfoFromConfigMap(t *testing.T) {
113113
}
114114
}
115115

116+
// TestGetFSInfoFromConfigMap is a unit test for the GetFSInfoFromConfigMap function.
117+
// It verifies that the function correctly retrieves file system information from a ConfigMap.
118+
//
119+
// The test sets up a fake Kubernetes client with a predefined ConfigMap and Dataset,
120+
// then calls GetFSInfoFromConfigMap and compares the returned metadata with expected values.
121+
//
122+
// Steps:
123+
// 1. Create a fake ConfigMap containing FS configuration data.
124+
// 2. Create a fake Dataset associated with the ConfigMap.
125+
// 3. Use a fake client to simulate interactions with the Kubernetes API.
126+
// 4. Call GetFSInfoFromConfigMap with the dataset's name and namespace.
127+
// 5. Validate that the returned metadata matches the expected values.
128+
//
129+
// If the function does not return the correct values, the test fails with an error message.
116130
func TestGetFSInfoFromConfigMap(t *testing.T) {
117131
configMap := &v1.ConfigMap{
118132
ObjectMeta: metav1.ObjectMeta{

0 commit comments

Comments
 (0)