SophieTech88 commented on code in PR #860:
URL: https://github.com/apache/yunikorn-core/pull/860#discussion_r1582007198
##########
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:
Thanks for the suggestions:
1. Run the `make lint` , then update the format.
2. update the Resource, use the same example.
--
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]