mirror of
https://github.com/coredns/coredns.git
synced 2025-12-06 10:25:10 -05:00
test(metrics): improve test coverage (#7538)
Add more unit tests for metrics plugin, around registration deduplication, zone management, restart/shutdown behavior and context helpers. Increases test coverage from 54.8% to 76.1%. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -40,3 +40,10 @@ func TestPrometheusParse(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetupBasic(t *testing.T) {
|
||||
c := caddy.NewTestController("dns", "prometheus localhost:9153")
|
||||
if err := setup(c); err != nil {
|
||||
t.Fatalf("setup returned error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user