0yukali0 commented on code in PR #405:
URL: https://github.com/apache/yunikorn-core/pull/405#discussion_r850137431


##########
pkg/scheduler/objects/node_collection_test.go:
##########
@@ -120,3 +121,56 @@ func TestNodeCollection_GetNodes(t *testing.T) {
        nodes = nc.GetNodes()
        assert.Equal(t, 1, len(nodes), "list is missing node")
 }
+
+func TestGetNodeSortingPolicy(t *testing.T) {
+       nc := NewNodeCollection("test")
+       weights := map[string]float64{
+               "vcore":  2.0,
+               "memory": 3.0,
+       }
+
+       var tests = []struct {
+               input  string
+               except string
+       }{
+               {"fair", "fair"},
+               {"bin", "bin"},
+       }
+
+       for _, tt := range tests {
+               testname := fmt.Sprintf("Get method of base_collection:%s %s", 
tt.input, tt.except)
+               t.Run(testname, func(t *testing.T) {
+                       policy := NewNodeSortingPolicy(tt.input, weights)
+                       nc.SetNodeSortingPolicy(policy)

Review Comment:
   Got it.
   I will add these scenarios in SetSortingPolicy and GetNodeIterator unit test.
   Thanks for your feedback, @wilfred-s 



-- 
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