Documentation ¶
Index ¶
- Constants
- func MainTest()
- type Agent
- type FakeAzurePipelinesPlatformServer
- func (f *FakeAzurePipelinesPlatformServer) AddJob(jobId int, poolId int, duration, startDelay, finishDelay int64, ...) error
- func (f *FakeAzurePipelinesPlatformServer) CancelJob(jobId int) error
- func (f *FakeAzurePipelinesPlatformServer) CreatePool(poolId int, poolName string)
- func (f *FakeAzurePipelinesPlatformServer) Reset()
- func (f *FakeAzurePipelinesPlatformServer) Start(port int) error
- func (f *FakeAzurePipelinesPlatformServer) Stop() error
- type Job
- type JobState
- type Request
- type RequestType
Constants ¶
View Source
const AgentsContainerUrl = "/_apis/distributedtask/pools/{pool-id:[0-9]+}/agents"
View Source
const AssignJobUrl = "/fake-api/assign-job/{job-id:[0-9]+}"
View Source
const DefaultPort = 8181
View Source
const FinishJobUrl = "/fake-api/finish-job/{job-id:[0-9]+}"
View Source
const JobsListUrl = "/_apis/distributedtask/pools/{pool-id:[0-9]+}/jobrequests"
View Source
const ListPoolsUrl = "/_apis/distributedtask/pools"
View Source
const SpecificAgentUrl = "/_apis/distributedtask/pools/{pool-id:[0-9]+}/agents/{agent-id:[0-9]+}"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FakeAzurePipelinesPlatformServer ¶
type FakeAzurePipelinesPlatformServer struct { Jobs []Job Agents []Agent Requests []Request PoolId int PoolName string // contains filtered or unexported fields }
func NewFakeAzurePipelinesPlatformServer ¶
func NewFakeAzurePipelinesPlatformServer() *FakeAzurePipelinesPlatformServer
func (*FakeAzurePipelinesPlatformServer) AddJob ¶
func (f *FakeAzurePipelinesPlatformServer) AddJob(jobId int, poolId int, duration, startDelay, finishDelay int64, demands map[string]string) error
AddJob advertises a new job. It is called from the test code.
func (*FakeAzurePipelinesPlatformServer) CancelJob ¶
func (f *FakeAzurePipelinesPlatformServer) CancelJob(jobId int) error
CancelJob cancels the job with the given jobId, by deleting it from the list of jobs. It is called from the test code.
func (*FakeAzurePipelinesPlatformServer) CreatePool ¶
func (f *FakeAzurePipelinesPlatformServer) CreatePool(poolId int, poolName string)
CreatePool initializes the pool with the given poolId and poolName. It is called from the test code.
func (*FakeAzurePipelinesPlatformServer) Reset ¶
func (f *FakeAzurePipelinesPlatformServer) Reset()
Reset resets the fake platform server. It is called from the test code.
func (*FakeAzurePipelinesPlatformServer) Start ¶
func (f *FakeAzurePipelinesPlatformServer) Start(port int) error
Start starts the fake platform server on the given port, using DefaultPort by default. The server runs in the background, meaning that Start does not block for long (only half a second to check for port-binding errors).
func (*FakeAzurePipelinesPlatformServer) Stop ¶
func (f *FakeAzurePipelinesPlatformServer) Stop() error
Stop stops the fake platform server. After stopping it, it cannot be started again.
type RequestType ¶
type RequestType string
const ( ListJob RequestType = "ListJob" ListAgent RequestType = "ListAgent" CreateAgent RequestType = "CreateAgent" ReplaceAgent RequestType = "ReplaceAgent" DeleteAgent RequestType = "DeleteAgent" GetPoolId RequestType = "GetPoolId" AssignJob RequestType = "AssignJob" FinishJob RequestType = "FinishJob" )
Click to show internal directories.
Click to hide internal directories.