本文整理匯總了Golang中github.com/concourse/atc/db/fakes.FakePipelineDB.LoadVersionsDBReturns方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakePipelineDB.LoadVersionsDBReturns方法的具體用法?Golang FakePipelineDB.LoadVersionsDBReturns怎麽用?Golang FakePipelineDB.LoadVersionsDBReturns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/concourse/atc/db/fakes.FakePipelineDB
的用法示例。
在下文中一共展示了FakePipelineDB.LoadVersionsDBReturns方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
//construct Version db
pipelineDB.LoadVersionsDBReturns(
&algorithm.VersionsDB{
ResourceVersions: []algorithm.ResourceVersion{
{
VersionID: 73,
ResourceID: 127,
},
},
BuildOutputs: []algorithm.BuildOutput{
{
ResourceVersion: algorithm.ResourceVersion{
VersionID: 73,
ResourceID: 127,
},
BuildID: 66,
JobID: 13,
},
},
JobIDs: map[string]int{
"bad-luck-job": 13,
},
ResourceIDs: map[string]int{
"resource-127": 127,
},
CachedAt: time.Unix(42, 0).UTC(),
},
nil,
)
})
示例2:
Name: "some-resource",
Source: atc.Source{"some": "source"},
},
{
Name: "some-other-resource",
Source: atc.Source{"some": "other-source"},
},
},
}, 42, true, nil)
})
Context("when the versions can be loaded", func() {
versionsDB := &algorithm.VersionsDB{}
BeforeEach(func() {
pipelineDB.LoadVersionsDBReturns(versionsDB, nil)
})
Context("when the input versions for the job can be determined", func() {
BeforeEach(func() {
pipelineDB.GetLatestInputVersionsReturns([]db.BuildInput{
{
Name: "some-input",
VersionedResource: db.VersionedResource{
Resource: "some-resource",
Type: "some-type",
Version: db.Version{"some": "version"},
PipelineName: "some-pipeline",
},
},
{
示例3:
},
BuildID: 3,
JobID: 4,
},
{
ResourceVersion: algorithm.ResourceVersion{
VersionID: 1,
ResourceID: 2,
},
BuildID: 7,
JobID: 8,
},
},
}
pipelineDB.LoadVersionsDBReturns(someVersions, nil)
scheduler.TryNextPendingBuildStub = func(lager.Logger, *algorithm.VersionsDB, atc.JobConfig, atc.ResourceConfigs) Waiter {
return new(sync.WaitGroup)
}
initialConfig = atc.Config{
Jobs: atc.JobConfigs{
{
Name: "some-job",
},
{
Name: "some-other-job",
},
},