當前位置: 首頁>>代碼示例>>Golang>>正文


Golang FakePipelineDB.LoadVersionsDBReturns方法代碼示例

本文整理匯總了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,
				)
			})
開發者ID:pcfdev-forks,項目名稱:atc,代碼行數:31,代碼來源:pipelines_test.go

示例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",
										},
									},
									{
開發者ID:pcfdev-forks,項目名稱:atc,代碼行數:31,代碼來源:jobs_test.go

示例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",
				},
			},
開發者ID:ACPK,項目名稱:atc,代碼行數:30,代碼來源:runner_test.go


注:本文中的github.com/concourse/atc/db/fakes.FakePipelineDB.LoadVersionsDBReturns方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。