Example #1
0
				//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,
				)
			})
Example #2
0
									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",
										},
									},
									{
Example #3
0
					},
					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",
				},
			},