runtest

package
v0.0.0-...-51f9457 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package runtest implements tests for working with Run Manager.

Package runtest implements tests for working with Run Manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreEnded

func AreEnded(runs ...*run.Run) bool

AreEnded is true if all runs are not nil and have ended.

func AreRunning

func AreRunning(runs ...*run.Run) bool

AreRunning is true if all runs are non-nil and Running.

func AssertEventboxEmpty

func AssertEventboxEmpty(ctx context.Context, runID common.RunID)

AssertEventboxEmpty asserts the eventbox of the provided Run is empty.

func AssertInEventbox

func AssertInEventbox(ctx context.Context, runID common.RunID, targets ...*eventpb.Event)

AssertInEventbox asserts all target events exist in the Eventbox.

func AssertNotInEventbox

func AssertNotInEventbox(ctx context.Context, runID common.RunID, targets ...*eventpb.Event)

AssertNotInEventbox asserts none of the target events exists in the Eventbox.

func AssertNotReceivedCLSubmitted

func AssertNotReceivedCLSubmitted(ctx context.Context, runID common.RunID, cl common.CLID)

AssertNotReceivedCLSubmitted asserts Run has NOT received CLSubmitted event for the provided CL.

func AssertReceivedCLSubmitted

func AssertReceivedCLSubmitted(ctx context.Context, runID common.RunID, cl common.CLID)

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

func AssertReceivedPoke(ctx context.Context, runID common.RunID, eta time.Time)

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

func AssertReceivedReadyForSubmission(ctx context.Context, runID common.RunID, eta time.Time)

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 Runs

func Runs(in tqtesting.TaskList) (runs common.RunIDs)

Runs returns list of runs from tasks for Run Manager.

func ShouldResembleRun

func ShouldResembleRun(actual interface{}, expected ...interface{}) string

ShouldResembleRun compares 2 Runs.

func SortedRuns

func SortedRuns(in tqtesting.TaskList) common.RunIDs

SortedRuns returns sorted list of runs from tasks for Run Manager.

func Tasks

Tasks returns all Run tasks sorted by ETA.

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.

Jump to

Keyboard shortcuts

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