本文整理汇总了Golang中github.com/concourse/atc/worker/fakes.FakeWorker类的典型用法代码示例。如果您正苦于以下问题:Golang FakeWorker类的具体用法?Golang FakeWorker怎么用?Golang FakeWorker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeWorker类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
)
var _ = Describe("Baggage-collecting image resource volumes", func() {
Context("when there is a single job", func() {
var (
fakeWorkerClient *wfakes.FakeClient
workerA *wfakes.FakeWorker
workerB *wfakes.FakeWorker
workerBBaggageClaimClient *bcfakes.FakeClient
dockerVolume *bcfakes.FakeVolume
workerC *wfakes.FakeWorker
workerCBaggageClaimClient *bcfakes.FakeClient
crossedWiresVolume *bcfakes.FakeVolume
fakeBaggageCollectorDB *fakes.FakeBaggageCollectorDB
fakePipelineDBFactory *dbfakes.FakePipelineDBFactory
expectedOldVersionTTL = 4 * time.Minute
expectedLatestVersionTTL = time.Duration(0)
expectedOneOffTTL = 5 * time.Hour
baggageCollector lostandfound.BaggageCollector
savedPipeline db.SavedPipeline
fakePipelineDB *dbfakes.FakePipelineDB
)
BeforeEach(func() {
fakeWorkerClient = new(wfakes.FakeClient)
示例2:
logger,
metadata,
session,
initType,
[]string{"resource", "tags"},
cacheIdentifier,
)
})
Context("when a container does not exist for the session", func() {
BeforeEach(func() {
workerClient.FindContainerForIdentifierReturns(nil, false, nil)
})
Context("when a worker is found", func() {
var satisfyingWorker *wfakes.FakeWorker
BeforeEach(func() {
satisfyingWorker = new(wfakes.FakeWorker)
workerClient.SatisfyingReturns(satisfyingWorker, nil)
satisfyingWorker.CreateContainerReturns(fakeContainer, nil)
})
Context("when the worker supports volume management", func() {
var fakeBaggageclaimClient *bfakes.FakeClient
BeforeEach(func() {
fakeBaggageclaimClient = new(bfakes.FakeClient)
satisfyingWorker.VolumeManagerReturns(fakeBaggageclaimClient, true)
})
示例3:
wfakes "github.com/concourse/atc/worker/fakes"
bcfakes "github.com/concourse/baggageclaim/fakes"
)
var _ = Describe("Baggage-collecting image resource volumes created by one-off builds", func() {
var (
fakeWorkerClient *wfakes.FakeClient
worker1 *wfakes.FakeWorker
worker2 *wfakes.FakeWorker
baggageClaimClient2 *bcfakes.FakeClient
volume2 *bcfakes.FakeVolume
fakeBaggageCollectorDB *fakes.FakeBaggageCollectorDB
fakePipelineDBFactory *dbfakes.FakePipelineDBFactory
expectedOldVersionTTL = 4 * time.Minute
expectedLatestVersionTTL = time.Duration(0)
expectedOneOffTTL = 5 * time.Hour
baggageCollector lostandfound.BaggageCollector
savedPipeline db.SavedPipeline
fakePipelineDB *dbfakes.FakePipelineDB
)
BeforeEach(func() {
fakeWorkerClient = new(wfakes.FakeClient)
worker1 = new(wfakes.FakeWorker)
示例4:
{
Name: "some-resource-type",
Type: "some-underlying-type",
Source: atc.Source{"some": "source"},
},
}
})
JustBeforeEach(func() {
satisfyingWorker, satisfyingErr = pool.Satisfying(spec, resourceTypes)
})
Context("with multiple workers", func() {
var (
workerA *fakes.FakeWorker
workerB *fakes.FakeWorker
workerC *fakes.FakeWorker
)
BeforeEach(func() {
workerA = new(fakes.FakeWorker)
workerB = new(fakes.FakeWorker)
workerC = new(fakes.FakeWorker)
workerA.SatisfyingReturns(workerA, nil)
workerB.SatisfyingReturns(workerB, nil)
workerC.SatisfyingReturns(nil, errors.New("nope"))
fakeProvider.WorkersReturns([]Worker{workerA, workerB, workerC}, nil)
})
示例5:
)
BeforeEach(func() {
id = Identifier{Name: "some-name"}
spec = ResourceTypeContainerSpec{Type: "some-type"}
})
JustBeforeEach(func() {
createdContainer, createErr = pool.CreateContainer(id, spec)
})
Context("with multiple workers", func() {
var (
workerA *fakes.FakeWorker
workerB *fakes.FakeWorker
workerC *fakes.FakeWorker
fakeContainer *fakes.FakeContainer
)
BeforeEach(func() {
workerA = new(fakes.FakeWorker)
workerB = new(fakes.FakeWorker)
workerC = new(fakes.FakeWorker)
workerA.ActiveContainersReturns(3)
workerB.ActiveContainersReturns(2)
workerA.SatisfiesReturns(true)
workerB.SatisfiesReturns(true)
示例6:
"github.com/concourse/atc/lostandfound/fakes"
"github.com/concourse/atc/worker"
wfakes "github.com/concourse/atc/worker/fakes"
"github.com/concourse/baggageclaim"
bcfakes "github.com/concourse/baggageclaim/fakes"
)
var _ = Describe("Baggage Collector", func() {
var (
fakeWorkerClient *wfakes.FakeClient
fakeWorker *wfakes.FakeWorker
fakeBaggageClaimClient *bcfakes.FakeClient
fakeBaggageCollectorDB *fakes.FakeBaggageCollectorDB
fakePipelineDBFactory *dbfakes.FakePipelineDBFactory
expectedOldResourceGracePeriod = 4 * time.Minute
expectedLatestVersionTTL = time.Duration(0)
expectedOneOffTTL = 5 * time.Hour
baggageCollector lostandfound.BaggageCollector
)
type resourceConfigAndVersions struct {
config atc.ResourceConfig
versions []atc.Version
versionsToDisable []int
}
type baggageCollectionExample struct {
pipelineData map[string][]resourceConfigAndVersions
示例7:
wfakes "github.com/concourse/atc/worker/fakes"
bcfakes "github.com/concourse/baggageclaim/fakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Volumes are reaped", func() {
var (
fakeWorkerClient *wfakes.FakeClient
fakeWorker *wfakes.FakeWorker
fakeBaggageClaimClient *bcfakes.FakeClient
fakePipelineDBFactory *dbfakes.FakePipelineDBFactory
fakeBaggageCollectorDB *fakes.FakeBaggageCollectorDB
expectedOldResourceGracePeriod = 4 * time.Minute
expectedOneOffTTL = 5 * time.Hour
baggageCollector lostandfound.BaggageCollector
returnedSavedVolume db.SavedVolume
newestReturnedSavedVolume db.SavedVolume
returnedVolumes []db.SavedVolume
)
BeforeEach(func() {
fakeWorkerClient = new(wfakes.FakeClient)
fakeWorker = new(wfakes.FakeWorker)
fakeBaggageClaimClient = new(bcfakes.FakeClient)
baggageCollectorLogger := lagertest.NewTestLogger("test")
fakeBaggageCollectorDB = new(fakes.FakeBaggageCollectorDB)
fakePipelineDBFactory = new(dbfakes.FakePipelineDBFactory)