Documentation ¶
Overview ¶
Package cqdfake implements fake CQDaemon for use in tests.
The package is meant to be deleted after migration to CV is over. TODO(cbrug/1141880): delete this package.
Index ¶
Constants ¶
const StartingMessage = "CQ is trying da patch"
StartingMessage is what CQDaemon fake posts when starting working on a Run.
Yes, spelling is right -- this is what CQDaemon posted historically.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CQDFake ¶
type CQDFake struct { LUCIProject string CV migrationpb.MigrationServer GFake *gf.Fake // contains filtered or unexported fields }
func (*CQDFake) ActiveAttemptKeys ¶
Returns sorted slice of attempt keys.
func (*CQDFake) Close ¶
func (cqd *CQDFake) Close()
Close stops CQDaemon fake and waits for it to complete.
func (*CQDFake) SetCandidatesClbk ¶
func (cqd *CQDFake) SetCandidatesClbk(clbk CandidatesClbk)
SetCandidatesClbk (re)sets callback func called per CQDaemon loop if CQDaemon is in charge.
Set it to mock what would-be candidates if Gerrit was queried directly. NOTE: the FetchExcludedCLs will still be applied on the output of the callback.
func (*CQDFake) SetShouldCrashClbk ¶
func (cqd *CQDFake) SetShouldCrashClbk(clbk ShouldCrashClbk)
SetShouldCrashClbk (re)sets callback func.
func (*CQDFake) SetVerifyClbk ¶
func (cqd *CQDFake) SetVerifyClbk(clbk VerifyClbk)
SetVerifyClbk (re)sets callback func called per CQDaemon active attempt once per loop.
type CandidatesClbk ¶
type CandidatesClbk func() []*migrationpb.ReportedRun
CandidatesClbk is called if CQDaemon is in charge to get Runs to work on.
NOTE: the FetchExcludedCLs will still be applied on the output of the callback.
type Operation ¶
type Operation string
const (
OpReportFinishedRun Operation = "OpReportFinishedRun"
)
type ShouldCrashClbk ¶
ShouldCrashClbk is consulted to decide if CQD should crash.
key is attempt key if operation is specific to an Attempt.
type VerifyClbk ¶
type VerifyClbk func(r *migrationpb.ReportedRun) *migrationpb.ReportedRun
VerifyClbk called once per CL per CQDaemon iteration.
May modify the CL via copy-on-write and return the new value.