This is an automated email from the ASF dual-hosted git repository.
pbacsko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git
The following commit(s) were added to refs/heads/master by this push:
new 40e0dbc7 [YUNIKORN-2620] Update the TestCheckQueuesStructure function
without errorExpected check (#866)
40e0dbc7 is described below
commit 40e0dbc7c069144096f0dc2f5d72f7361e7b715a
Author: YUN SUN <[email protected]>
AuthorDate: Sat May 11 15:51:38 2024 +0200
[YUNIKORN-2620] Update the TestCheckQueuesStructure function without
errorExpected check (#866)
Closes: #866
Signed-off-by: Peter Bacsko <[email protected]>
---
pkg/common/configs/configvalidator_test.go | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/pkg/common/configs/configvalidator_test.go
b/pkg/common/configs/configvalidator_test.go
index 5e9a77df..b5c9a176 100644
--- a/pkg/common/configs/configvalidator_test.go
+++ b/pkg/common/configs/configvalidator_test.go
@@ -1916,14 +1916,12 @@ func TestCheckQueuesStructure(t *testing.T) {
testCases := []struct {
name string
partition *PartitionConfig
- errorExpected bool
expectedErrorMsg string
validateFunc func(t *testing.T, partition *PartitionConfig)
}{
{
name: "No Queues Configured",
partition: &PartitionConfig{Queues: nil},
- errorExpected: true,
expectedErrorMsg: "queue config is not set",
},
{
@@ -1933,7 +1931,6 @@ func TestCheckQueuesStructure(t *testing.T) {
{Name: "root", Parent: true},
},
},
- errorExpected: false,
validateFunc: func(t *testing.T, p *PartitionConfig) {
assert.Equal(t, 1, len(p.Queues), "There should
be exactly one queue")
assert.Equal(t, "root", p.Queues[0].Name, "Root
queue should be named 'root'")
@@ -1947,7 +1944,6 @@ func TestCheckQueuesStructure(t *testing.T) {
{Name: "non-root"},
},
},
- errorExpected: false,
validateFunc: func(t *testing.T, p *PartitionConfig) {
assert.Equal(t, 1, len(p.Queues), "There should
be exactly one queue in the new root")
assert.Equal(t, "root", p.Queues[0].Name, "Root
queue should be named 'root'")
@@ -1963,7 +1959,6 @@ func TestCheckQueuesStructure(t *testing.T) {
{Name: "queue2"},
},
},
- errorExpected: false,
validateFunc: func(t *testing.T, p *PartitionConfig) {
assert.Equal(t, 1, len(p.Queues), "There should
be exactly one queue in the new root")
assert.Equal(t, "root", p.Queues[0].Name, "Root
queue should be named 'root'")
@@ -1981,7 +1976,6 @@ func TestCheckQueuesStructure(t *testing.T) {
Resources:
Resources{Guaranteed: negativeResourceMap}},
},
},
- errorExpected: true,
expectedErrorMsg: "root queue must not have resource
limits set",
},
{
@@ -1994,21 +1988,21 @@ func TestCheckQueuesStructure(t *testing.T) {
Resources: Resources{Max:
negativeResourceMap}},
},
},
- errorExpected: true,
expectedErrorMsg: "root queue must not have resource
limits set",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err := checkQueuesStructure(tc.partition)
- if tc.errorExpected {
+ if tc.expectedErrorMsg != "" {
assert.ErrorContains(t, err,
tc.expectedErrorMsg, "Error message mismatch")
} else {
assert.NilError(t, err, "No error is expected")
- if tc.validateFunc != nil {
- tc.validateFunc(t, tc.partition)
- }
}
+ if tc.validateFunc != nil {
+ tc.validateFunc(t, tc.partition)
+ }
+
})
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]