Skip to content

Commit

Permalink
Merge pull request #3848 from LiilyZhang/zhangl/fixUnitTest
Browse files Browse the repository at this point in the history
fix unit test
  • Loading branch information
LiilyZhang authored Jul 21, 2023
2 parents 71ad5b5 + 23a2c09 commit 607cbd2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/path_node_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func Test_UpdateNodePolicy1(t *testing.T) {
t.Errorf("no node policy returned")
} else if fnp, err := FindNodePolicyForOutput(db); err != nil {
t.Errorf("failed to find node policy in db, error %v", err)
} else if len(fnp.Properties) != len(*propList)+NUM_BUILT_INS-3 {
} else if len(fnp.Properties) != len(*propList)+NUM_BUILT_INS-1 {
t.Errorf("incorrect node policy, there should be %v property defined, found: %v", NUM_BUILT_INS, *fnp)
} else if fnp.Properties[0].Name != propName {
t.Errorf("expected property %v, but received %v", propName, fnp.Properties[0].Name)
Expand All @@ -194,7 +194,7 @@ func Test_UpdateNodePolicy1(t *testing.T) {
t.Errorf("no node policy returned")
} else if fnp, err := FindNodePolicyForOutput(db); err != nil {
t.Errorf("failed to find node policy in db, error %v", err)
} else if len(fnp.Properties) != len(*propList)+NUM_BUILT_INS-3 {
} else if len(fnp.Properties) != len(*propList)+NUM_BUILT_INS-1 {
t.Errorf("incorrect node policy, there should be %v property defined, found: %v", NUM_BUILT_INS, *fnp)
} else if fnp.Properties[0].Name != propName {
t.Errorf("expected property %v, but received %v", propName, fnp.Properties[0].Name)
Expand Down
2 changes: 1 addition & 1 deletion exchangesync/node_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
var ExchangeNodePolicy *exchange.ExchangeNodePolicy

const NUM_BUILT_INS = 7
const CLUSTER_NUM_BUILT_INS = 4
const CLUSTER_NUM_BUILT_INS = 6

// Verify that a Node Policy Object can be created and saved the first time.
func Test_UpdateNodePolicy(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion producer/producer_protocol_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func (w *BaseProducerProtocolHandler) MatchClusterNamespace(tcPolicy *policy.Pol
} else {
compResult, _, reason := compcheck.CheckClusterNamespaceCompatibility(nodeType, cutil.GetClusterNamespace(), tcPolicy.ClusterNamespace, workload.ClusterDeployment, true, nil)
if compResult {
glog.V(5).Infof(BPPHlogString(w.Name(), fmt.Sprintf("cluster namespace matches. %v")))
glog.V(5).Infof(BPPHlogString(w.Name(), fmt.Sprintf("cluster namespace matches. %v", reason)))
} else {
glog.Errorf(BPPHlogString(w.Name(), fmt.Sprintf("cluster namespace not match. %v", reason)))
}
Expand Down

0 comments on commit 607cbd2

Please sign in to comment.