Beispiel #1
0
				Name:   "some-named-resource",
				Type:   "git",
				Source: atc.Source{"uri": "git://some-named-resource"},
			},
		}

		resourceTypes = atc.ResourceTypes{
			{
				Name:   "some-custom-resource",
				Type:   "custom-type",
				Source: atc.Source{"custom": "source"},
			},
		}

		lease = new(dbfakes.FakeLease)
		fakeBuildsDB.LeaseBuildSchedulingReturns(lease, true, nil)
	})

	Describe("BuildLatestInputs", func() {
		Context("when no inputs are available", func() {
			BeforeEach(func() {
				fakePipelineDB.GetLatestInputVersionsReturns(nil, false, nil)
			})

			It("returns no error", func() {
				err := scheduler.BuildLatestInputs(logger, someVersions, job, resources, resourceTypes)
				Expect(err).NotTo(HaveOccurred())
			})

			It("does not trigger a build", func() {
				scheduler.BuildLatestInputs(logger, someVersions, job, resources, resourceTypes)
Beispiel #2
0
				Source: atc.Source{"uri": "git://some-output-resource"},
			},
			{
				Name:   "some-resource-with-longer-name",
				Type:   "git",
				Source: atc.Source{"uri": "git://some-resource-with-longer-name"},
			},
			{
				Name:   "some-named-resource",
				Type:   "git",
				Source: atc.Source{"uri": "git://some-named-resource"},
			},
		}

		lease = new(dbfakes.FakeLease)
		fakeBuildsDB.LeaseBuildSchedulingReturns(lease, true, nil)
	})

	Describe("BuildLatestInputs", func() {
		Context("when no inputs are available", func() {
			BeforeEach(func() {
				fakePipelineDB.GetLatestInputVersionsReturns(nil, false, nil)
			})

			It("returns no error", func() {
				err := scheduler.BuildLatestInputs(logger, someVersions, job, resources)
				Expect(err).NotTo(HaveOccurred())
			})

			It("does not trigger a build", func() {
				scheduler.BuildLatestInputs(logger, someVersions, job, resources)