| // Copyright 2018 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| //go:build linux || darwin |
| "golang.org/x/build/buildlet" |
| "golang.org/x/build/types" |
| // Fake is a fake scheduler. |
| // NewFake returns a fake scheduler. |
| HostTypes: []SchedulerHostState{}, |
| // State returns the state of the fake scheduler. |
| func (f *Fake) State() (st SchedulerState) { return f.state } |
| // WaiterState is the waiter state of the fake scheduler. |
| func (f *Fake) WaiterState(waiter *SchedItem) (ws types.BuildletWaitStatus) { |
| return types.BuildletWaitStatus{ |
| Message: "buildlet created", |
| // GetBuildlet returns a fake buildlet client for the requested buildlet. |
| func (f *Fake) GetBuildlet(ctx context.Context, si *SchedItem) (buildlet.Client, error) { |
| return &buildlet.FakeClient{}, nil |