layer1: test namespace manager summary logging
This commit is contained in:
@@ -562,6 +562,26 @@ func TestNamespaceManagerSummary(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLogNamespaceManagerSummary(t *testing.T) {
|
||||
LogNamespaceManagerSummary(nil, "ignored", NamespaceManagerSummary{})
|
||||
|
||||
logger := zap.NewNop()
|
||||
summary := NamespaceManagerSummary{
|
||||
TotalNamespaces: 2,
|
||||
LiveNamespaces: 1,
|
||||
PhaseCounts: map[NamespacePhase]int{
|
||||
NamespacePhaseActive: 1,
|
||||
NamespacePhaseRemoved: 1,
|
||||
},
|
||||
SourceCounts: map[NamespaceSource]int{
|
||||
NamespaceSourceWatcher: 1,
|
||||
NamespaceSourceEnv: 1,
|
||||
},
|
||||
Subscribers: []string{"router", "buildermgr"},
|
||||
}
|
||||
|
||||
LogNamespaceManagerSummary(logger, "namespace summary", summary)
|
||||
}
|
||||
func TestLogNamespaceManagerSummaryWithNilLogger(t *testing.T) {
|
||||
LogNamespaceManagerSummary(nil, "ignored", NamespaceManagerSummary{TotalNamespaces: 1})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user