Documentation ¶
Overview ¶
Package eventlis provides an API to attach listeners that are called at events during the test execution.
Code can register a callback to be invoked after the reservation is complete but before any tests are executed by calling EventListener.AddBeforeTestsCallback:
ondatra.EventListener().AddBeforeTestsCallback(func (e *eventlis.BeforeTestsEvent) { handleBeforeTestsEvent(e) })
Code can register a callback to be invoked after all the tests are complete but before the reservation is released by calling EventListener.AddAfterTestsCallback:
ondatra.EventListener().AddAfterTestsCallback(func (e *eventlis.AfterTestsEvent) { handleAfterTestsEvent(e) })
These calls can be made from the test itself, from the binding, or from a helper library that the test imports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AfterTestsEvent ¶
type AfterTestsEvent struct {
ExitCode *int
}
AfterTestsEvent occurs after the tests are finished executing and before the reservation is released.
type BeforeTestsEvent ¶
type BeforeTestsEvent struct {
Reservation *binding.Reservation
}
BeforeTestsEvent occurs after the reservation is complete and before tests start executing.
type EventListener ¶
type EventListener struct{}
EventListener is an event listener API.
func (*EventListener) AddAfterTestsCallback ¶
func (el *EventListener) AddAfterTestsCallback(cb func(*AfterTestsEvent) error)
AddAfterTestsCallback adds a callback to run after the tests are finished executing and before the reservation is released.
func (*EventListener) AddBeforeTestsCallback ¶
func (el *EventListener) AddBeforeTestsCallback(cb func(*BeforeTestsEvent) error)
AddBeforeTestsCallback adds a callback to run after the reservation is complete and before tests start executing.