File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,24 @@ func TestUpdateCacheOfDataset(t *testing.T) {
116116 }
117117}
118118
119+ // TestUpdateDatasetStatus tests the UpdateDatasetStatus method of JindoEngine to ensure correct
120+ // dataset status updates under various phases. It validates:
121+ // 1. Phase transitions (Bound, Failed, None)
122+ // 2. Preservation of HCFS status fields during updates
123+ // 3. Proper synchronization of cache states from runtime status
124+ //
125+ // Test strategy:
126+ // - Creates mock Dataset and JindoRuntime objects in a test namespace
127+ // - Uses a fake Kubernetes client to simulate API server interactions
128+ // - Verifies three key aspects of DatasetStatus after updates:
129+ // a) Phase matches expected state
130+ // b) CacheStates are properly propagated from runtime status
131+ // c) HCFSStatus fields remain unchanged during phase transitions
132+ //
133+ // Test cases cover:
134+ // - Successful bound state update
135+ // - Failure state handling
136+ // - Default/none state transition
119137func TestUpdateDatasetStatus (t * testing.T ) {
120138 testDatasetInputs := []* datav1alpha1.Dataset {
121139 {
You can’t perform that action at this time.
0 commit comments