Documentation ¶
Overview ¶
Package fakequeue provides a fake implementation of taskcluster-queue in golang, The FakeQueue server stores tasks in-memory, it doesn't validate authentication, but implements most end-points correctly.
The aim of this package is to facilitate integration tests to be executed without dependency on a production deployment of taskcluster-queue. Running integration tests against production is important, but also slow, so being able run them locally without credentials is very nice.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeQueue ¶
type FakeQueue struct {
// contains filtered or unexported fields
}
FakeQueue is a taskcluster-queue implementation with certain limitations:
- No validation of authentication or authenorization
- Data stored in-memory
The FakeQueue supports the following end-points:
- task
- status
- createTask
- cancelTask
- claimWork
- claimTask
- reclaimTask
- reportCompleted
- reportFailed
- reportException
- createArtifact
- getArtifact
- getLatestArtifact
- listLatestArtifact
- pendingTasks
type Listener ¶
type Listener interface { // WaitForTask returns a channel that gets a nil message when taskID is // resolved, or an error if listening fails. WaitForTask(taskID string) <-chan error }
Listener provides and interface that allows waiting for task resolution.
This is not intended to be a generic pulse listening interface, it's intended to the minimum subset required to write integration test. This way we can implement it using Pulse/AMQP for integration testing and using FakeQueue for testing without credentials.
func NewFakeQueueListener ¶
NewFakeQueueListener returns a Listener implementation that waits for tasks to be resolved in the FakeQueue given.
func NewPulseListener ¶
NewPulseListener creates a listener implementation for production queue using pulse.