Documentation ¶
Index ¶
- Constants
- func Build(t testutils.TestingT, now time.Time) *buildbucket_api.ApiCommonBuildMessage
- func MockCancelBuild(mock *mockhttpclient.URLMock, id int64, msg string, err error)
- func MockHeartbeats(t testutils.TestingT, mock *mockhttpclient.URLMock, now time.Time, ...)
- func MockJobFailure(mock *mockhttpclient.URLMock, j *types.Job, now time.Time, expectErr error)
- func MockJobMishap(mock *mockhttpclient.URLMock, j *types.Job, now time.Time, expectErr error)
- func MockJobStarted(mock *mockhttpclient.URLMock, id int64, now time.Time, err error)
- func MockJobSuccess(mock *mockhttpclient.URLMock, j *types.Job, now time.Time, expectErr error, ...)
- func MockPeek(mock *mockhttpclient.URLMock, builds []*buildbucket_api.ApiCommonBuildMessage, ...)
- func MockTryLeaseBuild(mock *mockhttpclient.URLMock, id int64, now time.Time, err error)
- func Params(t testutils.TestingT, ...) buildbucket.Parameters
- type TryJobIntegrator
Constants ¶
View Source
const ( // API URLs API_URL_PROD = "https://cr-buildbucket.appspot.com/api/buildbucket/v1/" API_URL_TESTING = "http://localhost:8008/api/buildbucket/v1/" // Buildbucket buckets used for try jobs. BUCKET_PRIMARY = "skia.primary" BUCKET_INTERNAL = "skia.internal" BUCKET_TESTING = "skia.testing" // How often to send updates to Buildbucket. UPDATE_INTERVAL = 30 * time.Second // We attempt to renew leases in batches. This is the batch size. LEASE_BATCH_SIZE = 25 // We lease a build for this amount of time, and if we don't renew the // lease before the time is up, the build resets to "scheduled" status // and becomes available for leasing again. LEASE_DURATION = time.Hour // We use a shorter initial lease duration in case we succeed in leasing // a build but fail to insert the associated Job into the DB, eg. // because the scheduler was interrupted. LEASE_DURATION_INITIAL = 5 * time.Minute // How many pending builds to read from the bucket at a time. PEEK_MAX_BUILDS = 50 // How often to poll Buildbucket for newly-scheduled builds. POLL_INTERVAL = 10 * time.Second // This error reason indicates that we already marked the build as // finished. BUILDBUCKET_API_ERROR_REASON_COMPLETED = "BUILD_IS_COMPLETED" )
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(t testutils.TestingT, now time.Time) *buildbucket_api.ApiCommonBuildMessage
func MockCancelBuild ¶
func MockCancelBuild(mock *mockhttpclient.URLMock, id int64, msg string, err error)
func MockHeartbeats ¶
func MockJobFailure ¶
func MockJobMishap ¶
func MockJobStarted ¶
func MockJobSuccess ¶
func MockPeek ¶
func MockPeek(mock *mockhttpclient.URLMock, builds []*buildbucket_api.ApiCommonBuildMessage, now time.Time, cursor, nextcursor string, err error)
func MockTryLeaseBuild ¶
func Params ¶
func Params(t testutils.TestingT, builder, project, revision, server, issue, patchset string) buildbucket.Parameters
Types ¶
type TryJobIntegrator ¶
type TryJobIntegrator struct {
// contains filtered or unexported fields
}
TryJobIntegrator is responsible for communicating with Buildbucket to trigger try jobs and report their results.
func NewTryJobIntegrator ¶
func NewTryJobIntegrator(apiUrl, bucket, host string, c *http.Client, d db.JobDB, w *window.Window, projectRepoMapping map[string]string, rm repograph.Map, taskCfgCache *specs.TaskCfgCache, gerrit gerrit.GerritInterface) (*TryJobIntegrator, error)
NewTryJobIntegrator returns a TryJobIntegrator instance.
func (*TryJobIntegrator) Start ¶
func (t *TryJobIntegrator) Start(ctx context.Context)
Start initiates the TryJobIntegrator's heatbeat and polling loops. If the given Context is canceled, the loops stop.
Click to show internal directories.
Click to hide internal directories.