Пример #1
0
	It("schedules pending builds", func() {
		Eventually(scheduler.TryNextPendingBuildCallCount).Should(Equal(2))

		_, job, resources := scheduler.TryNextPendingBuildArgsForCall(0)
		Ω(job).Should(Equal(atc.JobConfig{Name: "some-job"}))
		Ω(resources).Should(Equal(initialConfig.Resources))

		_, job, resources = scheduler.TryNextPendingBuildArgsForCall(1)
		Ω(job).Should(Equal(atc.JobConfig{Name: "some-other-job"}))
		Ω(resources).Should(Equal(initialConfig.Resources))
	})

	It("schedules builds for new inputs", func() {
		Eventually(scheduler.BuildLatestInputsCallCount).Should(Equal(2))

		_, job, resources := scheduler.BuildLatestInputsArgsForCall(0)
		Ω(job).Should(Equal(atc.JobConfig{Name: "some-job"}))
		Ω(resources).Should(Equal(initialConfig.Resources))

		_, job, resources = scheduler.BuildLatestInputsArgsForCall(1)
		Ω(job).Should(Equal(atc.JobConfig{Name: "some-other-job"}))
		Ω(resources).Should(Equal(initialConfig.Resources))
	})

	Context("when in noop mode", func() {
		BeforeEach(func() {
			noop = true
		})

		It("does not start scheduling builds", func() {
			Consistently(scheduler.TryNextPendingBuildCallCount).Should(Equal(0))
Пример #2
0
		Expect(versions).To(Equal(someVersions))
		Expect(job).To(Equal(atc.JobConfig{Name: "some-job"}))
		Expect(resources).To(Equal(initialConfig.Resources))
		Expect(resourceTypes).To(Equal(initialConfig.ResourceTypes))

		_, versions, job, resources, resourceTypes = scheduler.TryNextPendingBuildArgsForCall(1)
		Expect(versions).To(Equal(someVersions))
		Expect(job).To(Equal(atc.JobConfig{Name: "some-other-job"}))
		Expect(resources).To(Equal(initialConfig.Resources))
		Expect(resourceTypes).To(Equal(initialConfig.ResourceTypes))
	})

	It("schedules builds for new inputs using the given versions dataset", func() {
		Eventually(scheduler.BuildLatestInputsCallCount).Should(Equal(2))

		_, versions, job, resources, resourceTypes := scheduler.BuildLatestInputsArgsForCall(0)
		Expect(versions).To(Equal(someVersions))
		Expect(job).To(Equal(atc.JobConfig{Name: "some-job"}))
		Expect(resources).To(Equal(initialConfig.Resources))
		Expect(resourceTypes).To(Equal(initialConfig.ResourceTypes))

		_, versions, job, resources, resourceTypes = scheduler.BuildLatestInputsArgsForCall(1)
		Expect(versions).To(Equal(someVersions))
		Expect(job).To(Equal(atc.JobConfig{Name: "some-other-job"}))
		Expect(resources).To(Equal(initialConfig.Resources))
		Expect(resourceTypes).To(Equal(initialConfig.ResourceTypes))
	})

	Context("when in noop mode", func() {
		BeforeEach(func() {
			noop = true