Documentation ¶
Overview ¶
Package pmtest implements tests for working with Project Manager.
Index ¶
- func AssertInEventbox(t testing.TB, ctx context.Context, project string, targets ...*prjpb.Event)
- func AssertNotInEventbox(t testing.TB, ctx context.Context, project string, targets ...*prjpb.Event)
- func AssertReceivedCLsNotified(t testing.TB, ctx context.Context, project string, cls []*changelist.CL)
- func AssertReceivedRunFinished(t testing.TB, ctx context.Context, runID common.RunID, status run.Status)
- func ETAsOF(in tqtesting.TaskList, luciProject string) []time.Time
- func ETAsWithin(in tqtesting.TaskList, luciProject string, d time.Duration, t time.Time) []time.Time
- func LatestETAof(in tqtesting.TaskList, luciProject string) time.Time
- func Projects(in tqtesting.TaskList) (projects []string)
- func PurgingCLs(in tqtesting.TaskList, luciProject string) []int64
- type MockDispatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertInEventbox ¶
AssertInEventbox asserts all events exist in the project Eventbox.
func AssertNotInEventbox ¶
func AssertNotInEventbox(t testing.TB, ctx context.Context, project string, targets ...*prjpb.Event)
AssertNotInEventbox asserts none of the events exists in the project Eventbox.
func AssertReceivedCLsNotified ¶
func AssertReceivedCLsNotified(t testing.TB, ctx context.Context, project string, cls []*changelist.CL)
AssertCLsUpdated asserts all events exist in the project Eventbox.
func AssertReceivedRunFinished ¶
func AssertReceivedRunFinished(t testing.TB, ctx context.Context, runID common.RunID, status run.Status)
AssertReceivedRunFinished asserts a RunFinished event has been delivered tor project's eventbox for the given Run.
func ETAsOF ¶
ETAsOf returns sorted list of ETAs for a given project.
Includes ETAs encoded in KickManageProjectTask tasks.
func ETAsWithin ¶
func ETAsWithin(in tqtesting.TaskList, luciProject string, d time.Duration, t time.Time) []time.Time
ETAsWithin returns sorted list of ETAs for a given project in t+-d range.
func LatestETAof ¶
LatestETAof returns time.Time of the latest task for a given project.
Includes ETAs encoded in KickManageProjectTask tasks. If none, returns Zero time.Time{}.
Types ¶
type MockDispatcher ¶
type MockDispatcher struct {
*cvtesting.DispatchRecorder
}
MockDispatcher records in memory what would have resulted in task enqueues for a PM.
func MockDispatch ¶
func MockDispatch(ctx context.Context) (context.Context, MockDispatcher)
MockDispatch installs and returns MockDispatcher for PM.
func (*MockDispatcher) PopProjects ¶
func (m *MockDispatcher) PopProjects() []string
PopProjects returns sorted list of Projects and resets the state.
func (*MockDispatcher) Projects ¶
func (m *MockDispatcher) Projects() []string
Projects returns sorted list of Projects.