Documentation
¶
Overview ¶
Package runtest implements tests for working with Run Manager.
Package runtest implements tests for working with Run Manager.
Index ¶
- func AreEnded(runs ...*run.Run) bool
- func AreRunning(runs ...*run.Run) bool
- func AssertEventboxEmpty(ctx context.Context, runID common.RunID)
- func AssertInEventbox(ctx context.Context, runID common.RunID, targets ...*eventpb.Event)
- func AssertNotInEventbox(ctx context.Context, runID common.RunID, targets ...*eventpb.Event)
- func AssertNotReceivedCLSubmitted(ctx context.Context, runID common.RunID, cl common.CLID)
- func AssertReceivedCLSubmitted(ctx context.Context, runID common.RunID, cl common.CLID)
- func AssertReceivedCLUpdate(ctx context.Context, runID common.RunID, clid common.CLID, eversion int)
- func AssertReceivedPoke(ctx context.Context, runID common.RunID, eta time.Time)
- func AssertReceivedReadyForSubmission(ctx context.Context, runID common.RunID, eta time.Time)
- func AssertReceivedSubmissionCompleted(ctx context.Context, runID common.RunID, sc *eventpb.SubmissionCompleted)
- func Runs(in tqtesting.TaskList) (runs common.RunIDs)
- func ShouldResembleRun(actual interface{}, expected ...interface{}) string
- func SortedRuns(in tqtesting.TaskList) common.RunIDs
- func Tasks(in tqtesting.TaskList) tqtesting.TaskList
- type MockDispatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreRunning ¶
AreRunning is true if all runs are non-nil and Running.
func AssertEventboxEmpty ¶
AssertEventboxEmpty asserts the eventbox of the provided Run is empty.
func AssertInEventbox ¶
AssertInEventbox asserts all target events exist in the Eventbox.
func AssertNotInEventbox ¶
AssertNotInEventbox asserts none of the target events exists in the Eventbox.
func AssertNotReceivedCLSubmitted ¶
AssertNotReceivedCLSubmitted asserts Run has NOT received CLSubmitted event for the provided CL.
func AssertReceivedCLSubmitted ¶
AssertReceivedCLSubmitted asserts Run has received CLSubmitted event for the provided CL.
func AssertReceivedCLUpdate ¶
func AssertReceivedCLUpdate(ctx context.Context, runID common.RunID, clid common.CLID, eversion int)
AssertReceivedCLUpdate asserts Run has received CLUpdated event for given CLID + EVersion.
func AssertReceivedPoke ¶
AssertReceivedPoke asserts Run has received Poke event that should be processed at `eta`.
If `eta` is not later than now, assert that Poke event should be processed immediately.
func AssertReceivedReadyForSubmission ¶
AssertReceivedReadyForSubmission asserts Run has received ReadyForSubmission event.
func AssertReceivedSubmissionCompleted ¶
func AssertReceivedSubmissionCompleted(ctx context.Context, runID common.RunID, sc *eventpb.SubmissionCompleted)
AssertReceivedSubmissionCompleted asserts Run has received the provided SubmissionCompleted event.
func ShouldResembleRun ¶
func ShouldResembleRun(actual interface{}, expected ...interface{}) string
ShouldResembleRun compares 2 Runs.
func SortedRuns ¶
SortedRuns returns sorted list of runs from tasks for Run Manager.
Types ¶
type MockDispatcher ¶
type MockDispatcher struct {
*cvtesting.DispatchRecorder
}
MockDispatcher records in memory what would have resulted in task enqueues for a Run Manager.
func MockDispatch ¶
func MockDispatch(ctx context.Context) (context.Context, MockDispatcher)
MockDispatch installs and returns MockDispatcher for Run Manager.
func (*MockDispatcher) PopRuns ¶
func (m *MockDispatcher) PopRuns() common.RunIDs
PopRuns returns sorted list of Run IDs and resets the state.
func (*MockDispatcher) Runs ¶
func (m *MockDispatcher) Runs() common.RunIDs
Runs returns sorted list of Run IDs.