client

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2017 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PostAnyArtifactRequest = mock.MatchedBy(func(i interface{}) bool {
	_, ok := i.(*queue.PostArtifactRequest)
	return ok
})
View Source
var PostS3ArtifactRequest = mock.MatchedBy(func(i interface{}) bool {
	r, ok := i.(*queue.PostArtifactRequest)
	if !ok {
		return false
	}
	var s3req queue.S3ArtifactRequest
	if json.Unmarshal(*r, &s3req) != nil {
		return false
	}
	return s3req.StorageType == "s3"
})

Functions

This section is empty.

Types

type MockQueue

type MockQueue struct {
	mock.Mock
}

MockQueue is a mocked TaskCluster queue client. Calls to methods exposed by the queue client will be recorded for assertion later and will respond with the data that was specified during creation of the mocked object.

For more information about each of these client methods, consult the taskcluster-clieng-go/queue package

func (*MockQueue) CancelTask

func (m *MockQueue) CancelTask(taskID string) (*queue.TaskStatusResponse, error)

func (*MockQueue) ClaimTask

func (m *MockQueue) ClaimTask(taskID, runID string, payload *queue.TaskClaimRequest) (*queue.TaskClaimResponse, error)

func (*MockQueue) CreateArtifact

func (m *MockQueue) CreateArtifact(taskID, runID, name string, payload *queue.PostArtifactRequest) (*queue.PostArtifactResponse, error)

func (*MockQueue) ExpectRedirectArtifact added in v0.0.5

func (m *MockQueue) ExpectRedirectArtifact(taskID string, runID int, name string) <-chan string

ExpectRedirectArtifact will setup m to expect a redirect artifact with given name for taskID and runID to be created. This function returns a channel for the url of the redirect artifact.

func (*MockQueue) ExpectS3Artifact added in v0.0.5

func (m *MockQueue) ExpectS3Artifact(taskID string, runID int, name string) <-chan []byte

ExpectS3Artifact will setup queue to expect an S3 artifact with given name to be created for taskID and runID using m and returns a channel which will receive the artifact.

func (*MockQueue) PollTaskUrls

func (m *MockQueue) PollTaskUrls(provisionerID, workerType string) (*queue.PollTaskUrlsResponse, error)

func (*MockQueue) ReclaimTask

func (m *MockQueue) ReclaimTask(taskID, runID string) (*queue.TaskReclaimResponse, error)

func (*MockQueue) ReportCompleted

func (m *MockQueue) ReportCompleted(taskID, runID string) (*queue.TaskStatusResponse, error)

func (*MockQueue) ReportException

func (m *MockQueue) ReportException(taskID, runID string, payload *queue.TaskExceptionRequest) (*queue.TaskStatusResponse, error)

func (*MockQueue) ReportFailed

func (m *MockQueue) ReportFailed(taskID, runID string) (*queue.TaskStatusResponse, error)

type Queue

Queue is an interface to the Queue client provided by the taskcluster-client-go package. Passing around an interface allows the queue client to be mocked

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL