Beispiel #1
0
			Expect(found).To(BeTrue())
			Expect(oneOffGot).To(Equal(oneOff))

			jobBuild, err := pipelineDB.CreateJobBuild("some-other-job")
			Expect(err).NotTo(HaveOccurred())
			Expect(jobBuild.Name).To(Equal("1"))

			nextOneOff, err := database.CreateOneOffBuild()
			Expect(err).NotTo(HaveOccurred())
			Expect(nextOneOff.ID).NotTo(BeZero())
			Expect(nextOneOff.ID).NotTo(Equal(oneOff.ID))
			Expect(nextOneOff.JobName).To(BeZero())
			Expect(nextOneOff.Name).To(Equal("2"))
			Expect(nextOneOff.Status).To(Equal(db.StatusPending))

			allBuilds, _, err := database.GetBuilds(db.Page{Limit: 100})
			Expect(err).NotTo(HaveOccurred())
			Expect(allBuilds).To(Equal([]db.Build{nextOneOff, jobBuild, oneOff}))
		})

		It("also creates buildpreparation", func() {
			buildPrep, found, err := database.GetBuildPreparation(oneOff.ID)
			Expect(err).NotTo(HaveOccurred())
			Expect(found).To(BeTrue())

			Expect(buildPrep.BuildID).To(Equal(oneOff.ID))
		})
	})

	Describe("build preparation update", func() {
		var (