tests: add coverage for options, types, and HTTP server
- options_test.go: GetOption, GetFloatOption, GetIntOption, GetBoolOption with native types, JSON round-trips, missing keys, and wrong types - types_test.go: Status JSON marshal/unmarshal (strings, legacy ints, round-trip, unknown values), CheckTarget.Scope/String, BuildRulesInfo, empty-ID rejection - server_test.go: /health, /collect (success, error, bad body), /definition, /evaluate (all rules, disabled rule), /report (HTML, metrics, bad body), missing endpoints without CheckerDefinitionProvider
This commit is contained in:
parent
ec4efcf671
commit
ef7fffd4b7
4 changed files with 631 additions and 0 deletions
|
|
@ -22,6 +22,9 @@ import (
|
|||
// resetRegistries clears the global registries between tests so that one
|
||||
// test's registration cannot leak into the next. The package-level maps are
|
||||
// the only shared state.
|
||||
//
|
||||
// Tests in this package MUST NOT use t.Parallel() because they mutate
|
||||
// these shared maps without synchronization.
|
||||
func resetRegistries() {
|
||||
checkerRegistry = map[string]*CheckerDefinition{}
|
||||
observationProviderRegistry = map[ObservationKey]ObservationProvider{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue