Documentation ¶
Index ¶
- func Concurrency(tb testing.TB, f func(ctx context.Context, harness *ConcurrencyHarness))
- func Context(f func(ctx context.Context))
- func Logging(tb testing.TB, f func(harness *LoggingHarness))
- func RequireNoUnexpectedErrors(f Fataler, errorTracker ErrorTracker)
- type ConcurrencyHarness
- type ErrorTracker
- type Fataler
- type LoggingHarness
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Concurrency ¶ added in v1.3.0
func Concurrency(tb testing.TB, f func(ctx context.Context, harness *ConcurrencyHarness))
creates a harness that should be used for running concurrent tests; these are tests that start long-running goroutines that need supervision the test function will run inside this function, and following the test running a synchronized shutdown of the supervised SUT will take place, followed by an assertion that no unexpected errors have been logged
func Logging ¶
func Logging(tb testing.TB, f func(harness *LoggingHarness))
func RequireNoUnexpectedErrors ¶
func RequireNoUnexpectedErrors(f Fataler, errorTracker ErrorTracker)
Types ¶
type ConcurrencyHarness ¶ added in v1.3.0
type ConcurrencyHarness struct { govnr.TreeSupervisor Logger log.Logger T testing.TB // contains filtered or unexported fields }
func (*ConcurrencyHarness) AllowErrorsMatching ¶ added in v1.3.0
func (h *ConcurrencyHarness) AllowErrorsMatching(pattern string)
type ErrorTracker ¶
type ErrorTracker interface {
HasErrors() bool
}
type LoggingHarness ¶
type LoggingHarness struct { Logger log.Logger T testing.TB // contains filtered or unexported fields }
func (*LoggingHarness) AllowErrorsMatching ¶
func (h *LoggingHarness) AllowErrorsMatching(pattern string)
Click to show internal directories.
Click to hide internal directories.