Help us shape the future of Go! Take the 2026 Go Developer Survey

testcontroller

package
v1.23.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestLogger

func NewTestLogger(t *testing.T) logr.Logger

NewTestLogger builds a logr.Logger using the -v=# command flag from klog. This is useful for using to configured controllers and the controller-manager. Must be called after `klog.InitFlags` and `flag.Parse`. To see all logs, use: go test github.com/GoogleContainerTools/config-sync/<package-path> -v -args -v=5

func RunTestSuite

func RunTestSuite(m *testing.M, setupFunc, cleanupFunc func() error) int

RunTestSuite runs a test suite with setup and cleanup.

func StartTestManager

func StartTestManager(t *testing.T, mgr manager.Manager) func()

StartTestManager starts the controller-manager in a go routine. Call the returned function in a defer to stop the manager and wait until it exits. This avoids async error logs from the test environment stopping before the controller-manager.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL