Documentation
¶
Overview ¶
Package testutils provides common test utilities for config manager testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertConfigManagerCaches ¶
func AssertConfigManagerCaches[T any]( t *testing.T, fileName string, configContent string, newManager func(configPath string) configmanager.ConfigManager[T], )
AssertConfigManagerCaches verifies that a config manager reuses a previously loaded configuration when the underlying file becomes invalid after the initial load.
func RunConfigManagerTests ¶
func RunConfigManagerTests[T any]( t *testing.T, newManager func(configPath string) configmanager.ConfigManager[T], scenarios []TestScenario[T], )
RunConfigManagerTests runs a comprehensive test suite for config managers.
Types ¶
type TestScenario ¶
type TestScenario[T any] struct { Name string ConfigContent string APIVersion string Kind string ExpectedName string ShouldError bool ValidationFunc func(t *testing.T, config *T) SetupFunc func(t *testing.T) string // Returns config path UseCustomConfigPath bool }
TestScenario represents a test scenario for config managers.
Click to show internal directories.
Click to hide internal directories.