pbacsko commented on code in PR #899:
URL: https://github.com/apache/yunikorn-core/pull/899#discussion_r1651035956


##########
pkg/scheduler/placement/rule_test.go:
##########
@@ -115,3 +115,20 @@ func TestReplaceDot(t *testing.T) {
                t.Errorf("replace start or end dots failed, name: %s, ", name)
        }
 }
+
+func TestBasicRuleGetName(t *testing.T) {
+       rule := &basicRule{}
+       expected := "unnamed rule"
+       if name := rule.getName(); name != expected {

Review Comment:
   just simply `name != "unnamed rule"`



##########
pkg/scheduler/placement/rule_test.go:
##########
@@ -115,3 +115,20 @@ func TestReplaceDot(t *testing.T) {
                t.Errorf("replace start or end dots failed, name: %s, ", name)
        }
 }
+
+func TestBasicRuleGetName(t *testing.T) {
+       rule := &basicRule{}
+       expected := "unnamed rule"
+       if name := rule.getName(); name != expected {
+               t.Errorf("expected %s, got %s", expected, name)
+       }
+}
+
+func TestBasicRuleRuleDAO(t *testing.T) {
+       rule := &basicRule{}
+       dao := rule.ruleDAO()
+       expectedName := "unnamed rule"
+       if dao.Name != expectedName {

Review Comment:
   nit: just simply `dao.Name != "unnamed rule`



##########
pkg/scheduler/placement/rule_test.go:
##########
@@ -115,3 +115,20 @@ func TestReplaceDot(t *testing.T) {
                t.Errorf("replace start or end dots failed, name: %s, ", name)
        }
 }
+
+func TestBasicRuleGetName(t *testing.T) {

Review Comment:
   Just rename this to `TestBasicRule()` and add check for `getParent()` as 
well (it is covered once from a different test, let's have a direct 
verification here).
   
   The `ruleDAO()` assertions can be in the same method.



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