Documentation ¶
Overview ¶
Package hivetest makes testing components using hive easier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lifecycle ¶
Lifecycle returns a hive.Lifecycle which executes start hooks immediately and queues stop hooks for the end of the test.
Types ¶
type MockHealthReporter ¶
MockHealthReporter is a mock implementation of cell.HealthReporter type. It provides a minimal implementation that can notify on events via an unbuffered channel. Further updates will block until all events are observed.
Empty initialization provides an implementation that is a no-op and will not notify on any updates.
func NewMockHealthReporter ¶
func NewMockHealthReporter() *MockHealthReporter
NewMockHealthReporter creates a new mock health reporter which will block until the event is consumed on the Wait channel.
func (*MockHealthReporter) Degraded ¶
func (m *MockHealthReporter) Degraded(msg string, err error)
Degraded updates with Degraded status.
func (*MockHealthReporter) OK ¶
func (m *MockHealthReporter) OK(msg string)
OK updates with OK status.
func (*MockHealthReporter) Stopped ¶
func (m *MockHealthReporter) Stopped(msg string)
Degraded updates with Stopped status, but will not actually stop the test reporter.
func (*MockHealthReporter) Wait ¶
func (m *MockHealthReporter) Wait() <-chan Update
Wait returns a channel that will receive updates on the health status.