Documentation ¶
Index ¶
- type TestClient
- func (c *TestClient) CancelTask(ctx context.Context, id string, killRunning bool) error
- func (c *TestClient) DeleteBots(ctx context.Context, bots []string) error
- func (c *TestClient) DoMockTasks(f func(*swarming_api.SwarmingRpcsTaskRequestMetadata))
- func (c *TestClient) GetStates(ctx context.Context, ids []string) ([]string, error)
- func (c *TestClient) GetStdoutOfTask(ctx context.Context, id string) (*swarming_api.SwarmingRpcsTaskOutput, error)
- func (c *TestClient) GetTask(ctx context.Context, id string, includePerformanceStats bool) (*swarming_api.SwarmingRpcsTaskResult, error)
- func (c *TestClient) GetTaskMetadata(ctx context.Context, id string) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
- func (c *TestClient) GracefullyShutdownBot(ctx context.Context, id string) (*swarming_api.SwarmingRpcsTerminateResponse, error)
- func (c *TestClient) ListBotTasks(ctx context.Context, botID string, limit int) ([]*swarming_api.SwarmingRpcsTaskResult, error)
- func (c *TestClient) ListBots(ctx context.Context, dimensions map[string]string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
- func (c *TestClient) ListBotsForDimensions(ctx context.Context, dimensions map[string]string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
- func (c *TestClient) ListBotsForPool(ctx context.Context, pool string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
- func (c *TestClient) ListDownBots(ctx context.Context, pool string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
- func (c *TestClient) ListFreeBots(ctx context.Context, pool string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
- func (c *TestClient) ListSkiaTasks(ctx context.Context, start, end time.Time) ([]*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
- func (c *TestClient) ListTaskResults(ctx context.Context, start, end time.Time, tags []string, state string, ...) ([]*swarming_api.SwarmingRpcsTaskResult, error)
- func (c *TestClient) ListTasks(ctx context.Context, start, end time.Time, tags []string, state string) ([]*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
- func (c *TestClient) MockBots(bots []*swarming_api.SwarmingRpcsBotInfo)
- func (c *TestClient) MockTasks(tasks []*swarming_api.SwarmingRpcsTaskRequestMetadata)
- func (c *TestClient) MockTriggerTaskDeduped(tags []string, extraTags ...string)
- func (c *TestClient) MockTriggerTaskFailure(tags []string)
- func (c *TestClient) MockTriggerTaskNoResource(tags []string)
- func (c *TestClient) RetryTask(ctx context.Context, t *swarming_api.SwarmingRpcsTaskRequestMetadata) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
- func (c *TestClient) SwarmingService() *swarming_api.Service
- func (c *TestClient) TriggerTask(ctx context.Context, t *swarming_api.SwarmingRpcsNewTaskRequest) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestClient ¶
type TestClient struct {
// contains filtered or unexported fields
}
func NewTestClient ¶
func NewTestClient() *TestClient
func (*TestClient) CancelTask ¶
func (*TestClient) DeleteBots ¶
func (c *TestClient) DeleteBots(ctx context.Context, bots []string) error
func (*TestClient) DoMockTasks ¶
func (c *TestClient) DoMockTasks(f func(*swarming_api.SwarmingRpcsTaskRequestMetadata))
DoMockTasks calls f for each mocked task, allowing goroutine-safe updates. f must not call any other method on c.
func (*TestClient) GetStdoutOfTask ¶
func (c *TestClient) GetStdoutOfTask(ctx context.Context, id string) (*swarming_api.SwarmingRpcsTaskOutput, error)
func (*TestClient) GetTask ¶
func (c *TestClient) GetTask(ctx context.Context, id string, includePerformanceStats bool) (*swarming_api.SwarmingRpcsTaskResult, error)
func (*TestClient) GetTaskMetadata ¶
func (c *TestClient) GetTaskMetadata(ctx context.Context, id string) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
func (*TestClient) GracefullyShutdownBot ¶
func (c *TestClient) GracefullyShutdownBot(ctx context.Context, id string) (*swarming_api.SwarmingRpcsTerminateResponse, error)
func (*TestClient) ListBotTasks ¶
func (c *TestClient) ListBotTasks(ctx context.Context, botID string, limit int) ([]*swarming_api.SwarmingRpcsTaskResult, error)
func (*TestClient) ListBots ¶
func (c *TestClient) ListBots(ctx context.Context, dimensions map[string]string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
func (*TestClient) ListBotsForDimensions ¶
func (c *TestClient) ListBotsForDimensions(ctx context.Context, dimensions map[string]string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
func (*TestClient) ListBotsForPool ¶
func (c *TestClient) ListBotsForPool(ctx context.Context, pool string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
func (*TestClient) ListDownBots ¶
func (c *TestClient) ListDownBots(ctx context.Context, pool string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
func (*TestClient) ListFreeBots ¶
func (c *TestClient) ListFreeBots(ctx context.Context, pool string) ([]*swarming_api.SwarmingRpcsBotInfo, error)
func (*TestClient) ListSkiaTasks ¶
func (c *TestClient) ListSkiaTasks(ctx context.Context, start, end time.Time) ([]*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
func (*TestClient) ListTaskResults ¶
func (c *TestClient) ListTaskResults(ctx context.Context, start, end time.Time, tags []string, state string, includePerformanceStats bool) ([]*swarming_api.SwarmingRpcsTaskResult, error)
func (*TestClient) ListTasks ¶
func (c *TestClient) ListTasks(ctx context.Context, start, end time.Time, tags []string, state string) ([]*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
func (*TestClient) MockBots ¶
func (c *TestClient) MockBots(bots []*swarming_api.SwarmingRpcsBotInfo)
func (*TestClient) MockTasks ¶
func (c *TestClient) MockTasks(tasks []*swarming_api.SwarmingRpcsTaskRequestMetadata)
MockTasks sets the tasks that can be returned from ListTasks, ListSkiaTasks, GetTaskMetadata, and GetTask. Replaces any previous tasks, including those automatically added by TriggerTask.
func (*TestClient) MockTriggerTaskDeduped ¶
func (c *TestClient) MockTriggerTaskDeduped(tags []string, extraTags ...string)
MockTriggerTaskDeduped forces the next call to TriggerTask which matches the given tags to result in a deduplicated task. The optional extraTags are added to the TaskResult in the TaskRequestMetadata returned by TriggerTask and are intended to help test unexpected behavior in deduplicated tasks.
func (*TestClient) MockTriggerTaskFailure ¶
func (c *TestClient) MockTriggerTaskFailure(tags []string)
MockTriggerTaskFailure forces the next call to TriggerTask which matches the given tags to fail.
func (*TestClient) MockTriggerTaskNoResource ¶
func (c *TestClient) MockTriggerTaskNoResource(tags []string)
MockTriggerTaskNoResource forces the next call to TriggerTask which matches the given tags to have NO_RESOURCE state.
func (*TestClient) RetryTask ¶
func (c *TestClient) RetryTask(ctx context.Context, t *swarming_api.SwarmingRpcsTaskRequestMetadata) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
func (*TestClient) SwarmingService ¶
func (c *TestClient) SwarmingService() *swarming_api.Service
func (*TestClient) TriggerTask ¶
func (c *TestClient) TriggerTask(ctx context.Context, t *swarming_api.SwarmingRpcsNewTaskRequest) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
TriggerTask automatically appends its result to the mocked tasks set by MockTasks.