Skip to content

Commit b770e19

Browse files
authored
Add Notation to TestSyncScheduleInfoToCacheNodes in pkg/ddc/jindo/nod… (#5026)
* Add Notation to TestSyncScheduleInfoToCacheNodes in pkg/ddc/jindo/node_test.go Signed-off-by: 211870298@naqing <211870298@smail.nju.edu.cn> * Add Notation to TestSyncScheduleInfoToCacheNodes in pkg/ddc/jindo/node_test.go Signed-off-by: 211870298@naqing <211870298@smail.nju.edu.cn> --------- Signed-off-by: 211870298@naqing <211870298@smail.nju.edu.cn>
1 parent bac2730 commit b770e19

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pkg/ddc/jindo/node_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import (
4545
// - withRunTime: Whether to initialize runtime and runtimeInfo.
4646
//
4747
// Returns:
48-
// - *JindoEngine: The generated JindoEngine instance.
48+
// - *JindoEngine: The generated JindoEngine instance.
4949
func getTestJindoEngineNode(client client.Client, name string, namespace string, withRunTime bool) *JindoEngine {
5050
engine := &JindoEngine{
5151
runtime: nil,
@@ -62,6 +62,14 @@ func getTestJindoEngineNode(client client.Client, name string, namespace string,
6262
return engine
6363
}
6464

65+
// TestSyncScheduleInfoToCacheNodes verifies the behavior of the SyncScheduleInfoToCacheNodes method in various scenarios.
66+
// This test checks how node labels are updated to reflect dataset scheduling based on worker Pods' node assignments.
67+
// It simulates different cluster states using fake Kubernetes clients and runtime objects, including:
68+
// - Nodes with/without prior dataset labels.
69+
// - Pods with or without appropriate controller references.
70+
// - Support for both StatefulSet and DaemonSet-based workers.
71+
// Each test case defines an expected set of nodes that should be labeled after the synchronization,
72+
// and the test compares the actual labeled nodes with the expected result to validate correctness.
6573
func TestSyncScheduleInfoToCacheNodes(t *testing.T) {
6674
type fields struct {
6775
// runtime *datav1alpha1.JindoRuntime

0 commit comments

Comments
 (0)