Documentation ¶
Index ¶
- type TestClient
- func (c *TestClient) BatchGetResult(context.Context, *apipb.BatchGetResultRequest, ...grpc.CallOption) (*apipb.BatchGetResultResponse, error)
- func (c *TestClient) CancelTask(_ context.Context, _ *apipb.TaskCancelRequest, _ ...grpc.CallOption) (*apipb.CancelResponse, error)
- func (c *TestClient) CancelTasks(context.Context, *apipb.TasksCancelRequest, ...grpc.CallOption) (*apipb.TasksCancelResponse, error)
- func (c *TestClient) CountBots(context.Context, *apipb.BotsCountRequest, ...grpc.CallOption) (*apipb.BotsCount, error)
- func (c *TestClient) CountTasks(context.Context, *apipb.TasksCountRequest, ...grpc.CallOption) (*apipb.TasksCount, error)
- func (c *TestClient) DeleteBot(_ context.Context, in *apipb.BotRequest, opts ...grpc.CallOption) (*apipb.DeleteResponse, error)
- func (c *TestClient) DeleteBots(_ context.Context, bots []string) error
- func (c *TestClient) DoMockTasks(f func(*apipb.TaskRequestMetadataResponse))
- func (c *TestClient) GetBot(_ context.Context, in *apipb.BotRequest, opts ...grpc.CallOption) (*apipb.BotInfo, error)
- func (c *TestClient) GetBotDimensions(_ context.Context, in *apipb.BotsDimensionsRequest, opts ...grpc.CallOption) (*apipb.BotsDimensions, error)
- func (c *TestClient) GetRequest(_ context.Context, in *apipb.TaskIdRequest, opts ...grpc.CallOption) (*apipb.TaskRequestResponse, error)
- func (c *TestClient) GetResult(_ context.Context, in *apipb.TaskIdWithPerfRequest, opts ...grpc.CallOption) (*apipb.TaskResultResponse, error)
- func (c *TestClient) GetStdout(_ context.Context, in *apipb.TaskIdWithOffsetRequest, opts ...grpc.CallOption) (*apipb.TaskOutputResponse, error)
- func (c *TestClient) ListBotEvents(_ context.Context, in *apipb.BotEventsRequest, opts ...grpc.CallOption) (*apipb.BotEventsResponse, error)
- func (c *TestClient) ListBotTasks(_ context.Context, in *apipb.BotTasksRequest, opts ...grpc.CallOption) (*apipb.TaskListResponse, error)
- func (c *TestClient) ListBots(_ context.Context, in *apipb.BotsRequest, opts ...grpc.CallOption) (*apipb.BotInfoListResponse, error)
- func (c *TestClient) ListTaskRequests(_ context.Context, in *apipb.TasksRequest, opts ...grpc.CallOption) (*apipb.TaskRequestsResponse, error)
- func (c *TestClient) ListTaskStates(_ context.Context, in *apipb.TaskStatesRequest, opts ...grpc.CallOption) (*apipb.TaskStates, error)
- func (c *TestClient) ListTasks(_ context.Context, req *apipb.TasksWithPerfRequest, _ ...grpc.CallOption) (*apipb.TaskListResponse, error)
- func (c *TestClient) MockBots(bots []*apipb.BotInfo)
- func (c *TestClient) MockTasks(tasks []*apipb.TaskRequestMetadataResponse)
- func (c *TestClient) MockTriggerTaskDeduped(tags []string, extraTags ...string)
- func (c *TestClient) MockTriggerTaskFailure(tags []string)
- func (c *TestClient) MockTriggerTaskNoResource(tags []string)
- func (c *TestClient) NewTask(ctx context.Context, t *apipb.NewTaskRequest, _ ...grpc.CallOption) (*apipb.TaskRequestMetadataResponse, error)
- func (c *TestClient) RetryTask(ctx context.Context, t *apipb.TaskRequestMetadataResponse) (*apipb.TaskRequestMetadataResponse, error)
- func (c *TestClient) TerminateBot(_ context.Context, in *apipb.TerminateRequest, opts ...grpc.CallOption) (*apipb.TerminateResponse, 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) BatchGetResult ¶
func (c *TestClient) BatchGetResult(context.Context, *apipb.BatchGetResultRequest, ...grpc.CallOption) (*apipb.BatchGetResultResponse, error)
These aren't used by our tests.
func (*TestClient) CancelTask ¶
func (c *TestClient) CancelTask(_ context.Context, _ *apipb.TaskCancelRequest, _ ...grpc.CallOption) (*apipb.CancelResponse, error)
func (*TestClient) CancelTasks ¶
func (c *TestClient) CancelTasks(context.Context, *apipb.TasksCancelRequest, ...grpc.CallOption) (*apipb.TasksCancelResponse, error)
func (*TestClient) CountBots ¶
func (c *TestClient) CountBots(context.Context, *apipb.BotsCountRequest, ...grpc.CallOption) (*apipb.BotsCount, error)
func (*TestClient) CountTasks ¶
func (c *TestClient) CountTasks(context.Context, *apipb.TasksCountRequest, ...grpc.CallOption) (*apipb.TasksCount, error)
func (*TestClient) DeleteBot ¶
func (c *TestClient) DeleteBot(_ context.Context, in *apipb.BotRequest, opts ...grpc.CallOption) (*apipb.DeleteResponse, error)
func (*TestClient) DeleteBots ¶
func (c *TestClient) DeleteBots(_ context.Context, bots []string) error
func (*TestClient) DoMockTasks ¶
func (c *TestClient) DoMockTasks(f func(*apipb.TaskRequestMetadataResponse))
DoMockTasks calls f for each mocked task, allowing goroutine-safe updates. f must not call any other method on c.
func (*TestClient) GetBot ¶
func (c *TestClient) GetBot(_ context.Context, in *apipb.BotRequest, opts ...grpc.CallOption) (*apipb.BotInfo, error)
func (*TestClient) GetBotDimensions ¶
func (c *TestClient) GetBotDimensions(_ context.Context, in *apipb.BotsDimensionsRequest, opts ...grpc.CallOption) (*apipb.BotsDimensions, error)
func (*TestClient) GetRequest ¶
func (c *TestClient) GetRequest(_ context.Context, in *apipb.TaskIdRequest, opts ...grpc.CallOption) (*apipb.TaskRequestResponse, error)
func (*TestClient) GetResult ¶
func (c *TestClient) GetResult(_ context.Context, in *apipb.TaskIdWithPerfRequest, opts ...grpc.CallOption) (*apipb.TaskResultResponse, error)
func (*TestClient) GetStdout ¶
func (c *TestClient) GetStdout(_ context.Context, in *apipb.TaskIdWithOffsetRequest, opts ...grpc.CallOption) (*apipb.TaskOutputResponse, error)
func (*TestClient) ListBotEvents ¶
func (c *TestClient) ListBotEvents(_ context.Context, in *apipb.BotEventsRequest, opts ...grpc.CallOption) (*apipb.BotEventsResponse, error)
func (*TestClient) ListBotTasks ¶
func (c *TestClient) ListBotTasks(_ context.Context, in *apipb.BotTasksRequest, opts ...grpc.CallOption) (*apipb.TaskListResponse, error)
func (*TestClient) ListBots ¶
func (c *TestClient) ListBots(_ context.Context, in *apipb.BotsRequest, opts ...grpc.CallOption) (*apipb.BotInfoListResponse, error)
func (*TestClient) ListTaskRequests ¶
func (c *TestClient) ListTaskRequests(_ context.Context, in *apipb.TasksRequest, opts ...grpc.CallOption) (*apipb.TaskRequestsResponse, error)
func (*TestClient) ListTaskStates ¶
func (c *TestClient) ListTaskStates(_ context.Context, in *apipb.TaskStatesRequest, opts ...grpc.CallOption) (*apipb.TaskStates, error)
func (*TestClient) ListTasks ¶
func (c *TestClient) ListTasks(_ context.Context, req *apipb.TasksWithPerfRequest, _ ...grpc.CallOption) (*apipb.TaskListResponse, error)
func (*TestClient) MockBots ¶
func (c *TestClient) MockBots(bots []*apipb.BotInfo)
func (*TestClient) MockTasks ¶
func (c *TestClient) MockTasks(tasks []*apipb.TaskRequestMetadataResponse)
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) NewTask ¶
func (c *TestClient) NewTask(ctx context.Context, t *apipb.NewTaskRequest, _ ...grpc.CallOption) (*apipb.TaskRequestMetadataResponse, error)
NewTask automatically appends its result to the mocked tasks set by MockTasks.
func (*TestClient) RetryTask ¶
func (c *TestClient) RetryTask(ctx context.Context, t *apipb.TaskRequestMetadataResponse) (*apipb.TaskRequestMetadataResponse, error)
func (*TestClient) TerminateBot ¶
func (c *TestClient) TerminateBot(_ context.Context, in *apipb.TerminateRequest, opts ...grpc.CallOption) (*apipb.TerminateResponse, error)