Documentation ¶
Overview ¶
Package e2e contains all CV end-to-end tests.
Index ¶
- func MakeCfgCombinable(cgName, gHost, gRepo, gRef string) *cfgpb.Config
- func MakeCfgSingular(cgName, gHost, gRepo, gRef string) *cfgpb.Config
- type Test
- func (t *Test) EarliestCreatedRunOf(ctx context.Context, lProject string) *run.Run
- func (t *Test) ExportedBQAttemptsCount() int
- func (t *Test) LastMessage(gHost string, gChange int64) *gerritpb.ChangeMessageInfo
- func (t *Test) LatestRunWithGerritCL(ctx context.Context, lProject, gHost string, gChange int64) *run.Run
- func (t *Test) LoadCL(ctx context.Context, id common.CLID) *changelist.CL
- func (t *Test) LoadGerritCL(ctx context.Context, gHost string, gChange int64) *changelist.CL
- func (t *Test) LoadGerritRuns(ctx context.Context, gHost string, gChange int64, lProject string) []*run.Run
- func (t *Test) LoadProject(ctx context.Context, lProject string) *prjmanager.Project
- func (t *Test) LoadRun(ctx context.Context, id common.RunID) *run.Run
- func (t *Test) LoadRunsOf(ctx context.Context, lProject string) []*run.Run
- func (t *Test) LogPhase(ctx context.Context, format string, args ...interface{})
- func (t *Test) MaxCQVote(ctx context.Context, gHost string, gChange int64) int32
- func (t *Test) MaxVote(ctx context.Context, gHost string, gChange int64, gLabel string) int32
- func (t *Test) MigrationContext(ctx context.Context) context.Context
- func (t *Test) MigrationFetchActiveRuns(ctx context.Context, project string) []*migrationpb.ActiveRun
- func (t *Test) MustCQD(ctx context.Context, luciProject string) *cqdfake.CQDFake
- func (t *Test) Now() time.Time
- func (t *Test) RunUntil(ctx context.Context, stopIf func() bool)
- func (t *Test) SetUp() (ctx context.Context, deferme func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeCfgCombinable ¶
MakeCfgCombinable return project config with a combinable ConfigGroup.
func MakeCfgSingular ¶
MakeCfgSingular return project config with a single ConfigGroup.
Types ¶
type Test ¶
type Test struct { *cvtesting.Test // auto-initialized if nil // CVDev if true sets e2e test to use `cv-dev` GAE app. // Defaults to `cv` GAE app. CVDev bool PMNotifier *prjmanager.Notifier RunNotifier *run.Notifier AdminServer adminpb.AdminServer MigrationServer migrationpb.MigrationServer // contains filtered or unexported fields }
Test encapsulates e2e setup for a CV test.
Embeds cvtesting.Test, which sets CV's dependencies and some simple CV components (e.g. TreeClient), while this Test focuses on setup of CV's own components.
Typical use:
ct := Test{CVDev: true} ctx, cancel := ct.SetUp() defer cancel() ... ct.RunUntil(ctx, func() bool { return len(ct.LoadRunsOf("project")) > 0 })
func (*Test) EarliestCreatedRunOf ¶
EarliestCreatedRun returns the earliest created Run in a project.
If there are several such runs, may return any one of them.
Returns nil if there are no Runs.
func (*Test) ExportedBQAttemptsCount ¶
ExportedBQAttemptsCount returns number of exported CQ Attempts.
func (*Test) LastMessage ¶
func (t *Test) LastMessage(gHost string, gChange int64) *gerritpb.ChangeMessageInfo
LastMessage returns the last message posted on a Gerrit CL from Gerrit fake.
Returns nil if there are no messages. Panics if the CL doesn't exist.
func (*Test) LatestRunWithGerritCL ¶
func (t *Test) LatestRunWithGerritCL(ctx context.Context, lProject, gHost string, gChange int64) *run.Run
LatestRunWithCL returns the latest created Run containing given CL.
If there are several, returns the one with latest .StartTime. Returns nil if there is such Runs, including if Gerrit CL isn't yet in DS.
func (*Test) LoadGerritCL ¶
LoadGerritCL returns CL entity or nil if not exists.
func (*Test) LoadGerritRuns ¶
func (t *Test) LoadGerritRuns(ctx context.Context, gHost string, gChange int64, lProject string) []*run.Run
LoadGerritRuns loads all Runs from Datastore which include a Gerrit CL.
func (*Test) LoadProject ¶
LoadProject returns Project entity or nil if not exists.
func (*Test) LoadRunsOf ¶
LoadRunsOf loads all Runs of a project from Datastore.
func (*Test) LogPhase ¶
LogPhase emits easy to recognize log like =========================== PHASE: .... ===========================
func (*Test) MaxCQVote ¶
MaxCQVote returns max CQ vote of a Gerrit CL loaded from Gerrit fake.
Returns 0 if there are no votes. Panics if CL doesn't exist.
func (*Test) MaxVote ¶
MaxVote returns max vote of a Gerrit CL loaded from Gerrit fake.
Returns 0 if there are no votes. Panics if CL doesn't exist.
func (*Test) MigrationContext ¶
MigrationContext returns context authorized to call to the Migration API.
func (*Test) MigrationFetchActiveRuns ¶
func (*Test) MustCQD ¶
MustCQD returns a CQDaemon fake for the given project, starting a new one if necessary, in which case it's lifetime is limited by the given context.