本文整理汇总了Golang中github.com/concourse/atc/exec/fakes.FakeStepFactory类的典型用法代码示例。如果您正苦于以下问题:Golang FakeStepFactory类的具体用法?Golang FakeStepFactory怎么用?Golang FakeStepFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeStepFactory类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
. "github.com/onsi/gomega"
"github.com/tedsuo/ifrit"
"github.com/concourse/atc/exec"
"github.com/concourse/atc/exec/fakes"
)
var _ = Describe("Ensure Step", func() {
var (
stepFactory *fakes.FakeStepFactory
hookFactory *fakes.FakeStepFactory
step *fakes.FakeStep
hook *fakes.FakeStep
previousStep *fakes.FakeStep
repo *exec.SourceRepository
ensureFactory exec.StepFactory
ensureStep exec.Step
)
BeforeEach(func() {
stepFactory = &fakes.FakeStepFactory{}
hookFactory = &fakes.FakeStepFactory{}
step = &fakes.FakeStep{}
hook = &fakes.FakeStep{}
previousStep = &fakes.FakeStep{}
示例2:
. "github.com/concourse/atc/exec"
"github.com/tedsuo/ifrit"
"github.com/concourse/atc/exec/fakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Retry Step", func() {
var (
attempt1Factory *fakes.FakeStepFactory
attempt1Step *fakes.FakeStep
attempt2Factory *fakes.FakeStepFactory
attempt2Step *fakes.FakeStep
attempt3Factory *fakes.FakeStepFactory
attempt3Step *fakes.FakeStep
stepFactory StepFactory
step Step
)
BeforeEach(func() {
attempt1Factory = new(fakes.FakeStepFactory)
attempt1Step = new(fakes.FakeStep)
attempt1Factory.UsingReturns(attempt1Step)
attempt2Factory = new(fakes.FakeStepFactory)
attempt2Step = new(fakes.FakeStep)
attempt2Factory.UsingReturns(attempt2Step)
示例3:
var errorMatching = MatchError
// check hook is executed - if step succeeds - DONE
// check hook is not executed if the step fails/errors - DONE
// when we send a signal it is forwarded to the currently running step - DONE
// what if steps cannot respond to success - don't need to cover this case because the contract guarentees this won't happen
var _ = Describe("On Success Step", func() {
var (
stepFactory *fakes.FakeStepFactory
successFactory *fakes.FakeStepFactory
step *fakes.FakeStep
hook *fakes.FakeStep
previousStep *fakes.FakeStep
repo *exec.SourceRepository
onSuccessFactory exec.StepFactory
onSuccessStep exec.Step
)
BeforeEach(func() {
stepFactory = &fakes.FakeStepFactory{}
successFactory = &fakes.FakeStepFactory{}
step = &fakes.FakeStep{}
hook = &fakes.FakeStep{}
previousStep = &fakes.FakeStep{}
示例4:
expectedMetadata = engine.StepMetadata{
BuildID: 84,
BuildName: "42",
JobName: "some-job",
PipelineName: "some-pipeline",
}
})
Context("running hooked composes", func() {
var (
taskStepFactory *execfakes.FakeStepFactory
taskStep *execfakes.FakeStep
inputStepFactory *execfakes.FakeStepFactory
inputStep *execfakes.FakeStep
outputStepFactory *execfakes.FakeStepFactory
outputStep *execfakes.FakeStep
dependentStepFactory *execfakes.FakeStepFactory
dependentStep *execfakes.FakeStep
)
BeforeEach(func() {
taskStepFactory = new(execfakes.FakeStepFactory)
taskStep = new(execfakes.FakeStep)
taskStep.ResultStub = successResult(true)
taskStepFactory.UsingReturns(taskStep)
fakeFactory.TaskReturns(taskStepFactory)
inputStepFactory = new(execfakes.FakeStepFactory)
示例5:
*x = result
return true
default:
return false
}
}
}
var _ = Describe("Conditional", func() {
var (
inStep *fakes.FakeStep
repo *SourceRepository
fakeStepFactory *fakes.FakeStepFactory
conditional Conditional
outStep *fakes.FakeStep
step Step
process ifrit.Process
)
BeforeEach(func() {
inStep = new(fakes.FakeStep)
repo = NewSourceRepository()
fakeStepFactory = new(fakes.FakeStepFactory)
outStep = new(fakes.FakeStep)
outStep.ResultStub = successResult(true)
示例6:
execEngine = engine.NewExecEngine(fakeFactory, fakeDelegateFactory, fakeDB)
fakeDelegate = new(fakes.FakeBuildDelegate)
fakeDelegateFactory.DelegateReturns(fakeDelegate)
buildModel = db.Build{ID: 84}
})
Describe("Resume", func() {
Context("get with nil location", func() {
var (
getStepFactory *execfakes.FakeStepFactory
getStep *execfakes.FakeStep
fakeDelegate *fakes.FakeBuildDelegate
fakeGetDelegate *execfakes.FakeGetDelegate
plan atc.Plan
)
BeforeEach(func() {
getStepFactory = new(execfakes.FakeStepFactory)
getStep = new(execfakes.FakeStep)
getStep.ResultStub = successResult(true)
getStepFactory.UsingReturns(getStep)
fakeFactory.GetReturns(getStepFactory)
fakeDelegate = new(fakes.FakeBuildDelegate)
fakeDelegateFactory.DelegateReturns(fakeDelegate)
示例7:
"github.com/concourse/atc/exec/fakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/tedsuo/ifrit"
)
var _ = Describe("Timeout Step", func() {
var (
fakeStepFactoryStep *fakes.FakeStepFactory
runStep *fakes.FakeStep
timeout StepFactory
step Step
startStep chan error
process ifrit.Process
timeoutDuration atc.Duration
)
BeforeEach(func() {
startStep = make(chan error, 1)
fakeStepFactoryStep = new(fakes.FakeStepFactory)
runStep = new(fakes.FakeStep)
fakeStepFactoryStep.UsingReturns(runStep)
})
示例8:
. "github.com/onsi/gomega"
"github.com/tedsuo/ifrit"
"github.com/concourse/atc/exec"
"github.com/concourse/atc/exec/fakes"
)
var _ = Describe("On Failure Step", func() {
var (
stepFactory *fakes.FakeStepFactory
failureFactory *fakes.FakeStepFactory
step *fakes.FakeStep
hook *fakes.FakeStep
previousStep *fakes.FakeStep
repo *exec.SourceRepository
onFailureFactory exec.StepFactory
onFailureStep exec.Step
)
BeforeEach(func() {
stepFactory = &fakes.FakeStepFactory{}
failureFactory = &fakes.FakeStepFactory{}
step = &fakes.FakeStep{}
hook = &fakes.FakeStep{}
previousStep = &fakes.FakeStep{}
示例9:
"github.com/concourse/atc/exec/fakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/tedsuo/ifrit"
)
var _ = Describe("Aggregate", func() {
var (
fakeStepA *fakes.FakeStepFactory
fakeStepB *fakes.FakeStepFactory
aggregate StepFactory
inStep *fakes.FakeStep
repo *SourceRepository
outStepA *fakes.FakeStep
outStepB *fakes.FakeStep
step Step
process ifrit.Process
)
BeforeEach(func() {
fakeStepA = new(fakes.FakeStepFactory)
fakeStepB = new(fakes.FakeStepFactory)
aggregate = Aggregate{
fakeStepA,
fakeStepB,
示例10:
fakeDelegateFactory = new(fakes.FakeBuildDelegateFactory)
fakeDB = new(fakes.FakeEngineDB)
execEngine = engine.NewExecEngine(fakeFactory, fakeDelegateFactory, fakeDB)
fakeDelegate = new(fakes.FakeBuildDelegate)
fakeDelegateFactory.DelegateReturns(fakeDelegate)
buildModel = db.Build{ID: 84}
})
Context("running timeout steps", func() {
var (
taskStepFactory *execfakes.FakeStepFactory
taskStep *execfakes.FakeStep
inputStepFactory *execfakes.FakeStepFactory
inputStep *execfakes.FakeStep
)
BeforeEach(func() {
taskStepFactory = new(execfakes.FakeStepFactory)
taskStep = new(execfakes.FakeStep)
taskStep.ResultStub = successResult(true)
taskStepFactory.UsingReturns(taskStep)
fakeFactory.TaskReturns(taskStepFactory)
inputStepFactory = new(execfakes.FakeStepFactory)
inputStep = new(execfakes.FakeStep)
inputStep.ResultStub = successResult(true)
inputStepFactory.UsingReturns(inputStep)
示例11:
// which defaults to returning whatever the previous step was from using. For
// this reason, the input step gets returned as the next step of type identity
// step, which returns nil when ran.
var _ = Describe("Hooked Compose", func() {
var (
fakeStepFactoryStep *fakes.FakeStepFactory
fakeStepFactoryNextStep *fakes.FakeStepFactory
hookedCompose StepFactory
inStep *fakes.FakeStep
repo *SourceRepository
outStep *fakes.FakeStep
nextStep *fakes.FakeStep
startStep chan error
finishStep chan error
startNextStep chan error
finishNextStep chan error
step Step
process ifrit.Process
)
BeforeEach(func() {
fakeStepFactoryStep = new(fakes.FakeStepFactory)
fakeStepFactoryNextStep = new(fakes.FakeStepFactory)
示例12:
. "github.com/onsi/gomega"
"github.com/tedsuo/ifrit"
)
var _ = Describe("Compose", func() {
var (
fakeStepFactoryA *fakes.FakeStepFactory
fakeStepFactoryB *fakes.FakeStepFactory
compose StepFactory
inStep *fakes.FakeStep
repo *SourceRepository
outStepA *fakes.FakeStep
outStepB *fakes.FakeStep
startA chan error
finishA chan error
startB chan error
finishB chan error
step Step
process ifrit.Process
)
BeforeEach(func() {
fakeStepFactoryA = new(fakes.FakeStepFactory)
fakeStepFactoryB = new(fakes.FakeStepFactory)