baconYao commented on code in PR #860:
URL: https://github.com/apache/yunikorn-core/pull/860#discussion_r1581996824


##########
pkg/common/configs/configvalidator_test.go:
##########
@@ -1910,3 +1910,80 @@ func TestCheckLimitsStructure(t *testing.T) {
        assert.Equal(t, len(partitionConfig.Queues[0].Limits), 0)
        assert.Equal(t, len(partitionConfig.Limits), 0)
 }
+
+
+func TestCheckQueuesStructure(t *testing.T) {
+    testCases := []struct {
+        name          string
+        partition     *PartitionConfig
+        errorExpected bool
+    }{
+        {
+            name: "No Queues Configured",
+            partition: &PartitionConfig{Queues: nil},
+            errorExpected: true,
+        },
+        {
+            name: "Single Root Queue",
+            partition: &PartitionConfig{
+                Queues: []QueueConfig{
+                    {Name: "root", Parent: true},
+                },
+            },
+            errorExpected: false,
+        },
+        {
+            name: "Single Non-Root Queue",
+            partition: &PartitionConfig{
+                Queues: []QueueConfig{
+                    {Name: "non-root"},
+                },
+            },
+            errorExpected: false,
+        },
+        {
+            name: "Multiple Top-Level Queues",
+            partition: &PartitionConfig{
+                Queues: []QueueConfig{
+                    {Name: "queue1"},
+                    {Name: "queue2"},
+                },
+            },
+            errorExpected: false,
+        },
+               {
+            name: "Root Queue With Guaranteed Resources",
+            partition: &PartitionConfig{
+                Queues: []QueueConfig{
+                    {
+                                               Name: "root", 
+                                               Parent: true, 
+                                               Resources: 
Resources{Guaranteed: map[string]string{"memory": "1000Mi"}}},

Review Comment:
   The indent here looks a little weird, not sure it's caused by IDE. The 
following picture is your code in my VScode IDE, looks like fine.
   
   <img width="876" alt="ζˆͺεœ– 2024-04-28 上午10 03 23" 
src="https://github.com/apache/yunikorn-core/assets/8318678/153437b7-54d2-490d-a893-ba5bdb6fe474";>
   
   But I still suggest that you can reference other pieces like 
[here](https://github.com/apache/yunikorn-core/blob/master/pkg/common/configs/configvalidator_test.go)
 to have good Indentation.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to