コード例 #1
0
				_, _, err = sqlDB.SaveConfig(team.Name, "some-pipeline", atc.Config{
					Jobs: []atc.JobConfig{
						{Name: "some-job-name"},
					},
				}, db.ConfigVersion(1), db.PipelineUnpaused)
				Expect(err).NotTo(HaveOccurred())

				_, _, err = sqlDB.SaveConfig(team.Name, "another-pipeline", atc.Config{
					Jobs: []atc.JobConfig{
						{Name: "another-job-name"},
					},
				}, db.ConfigVersion(1), db.PipelineUnpaused)
				Expect(err).NotTo(HaveOccurred())

				_, err = pipelineDBFactory.BuildWithTeamNameAndName(team.Name, "some-pipeline")
				Expect(err).NotTo(HaveOccurred())

				_, err = pipelineDBFactory.BuildWithTeamNameAndName(team.Name, "another-pipeline")
				Expect(err).NotTo(HaveOccurred())

			})

			homeLink := ".js-groups li:nth-of-type(2) a"
			defaultPipelineLink := ".js-pipelinesNav-list li:nth-of-type(1) a"
			anotherPipelineLink := ".js-pipelinesNav-list li:nth-of-type(2) a"
			anotherPipelineItem := ".js-pipelinesNav-list li:nth-of-type(2)"

			It("can pause the pipelines", func() {
				Expect(page.Navigate(homepage())).To(Succeed())
				// we will need to authenticate later to prove it is working for our page
コード例 #2
0
ファイル: job_pausing_test.go プロジェクト: pcfdev-forks/atc
						BasicAuth: db.BasicAuth{
							BasicAuthUsername: "******",
							BasicAuthPassword: "******",
						},
					})
				Expect(err).NotTo(HaveOccurred())

				// job build data
				_, _, err = sqlDB.SaveConfig(team.Name, atc.DefaultPipelineName, atc.Config{
					Jobs: []atc.JobConfig{
						{Name: "job-name"},
					},
				}, db.ConfigVersion(1), db.PipelineUnpaused)
				Expect(err).NotTo(HaveOccurred())

				pipelineDB, err = pipelineDBFactory.BuildWithTeamNameAndName(team.Name, atc.DefaultPipelineName)
				Expect(err).NotTo(HaveOccurred())

				build, err = pipelineDB.CreateJobBuild("job-name")
				Expect(err).NotTo(HaveOccurred())

				_, err = sqlDB.StartBuild(build.ID, "", "")
				Expect(err).NotTo(HaveOccurred())

				sqlDB.SaveBuildEvent(build.ID, event.Log{
					Origin: event.Origin{
						Source: event.OriginSourceStdout,
						ID:     "some-id",
					},
					Payload: "hello this is a payload",
				})
コード例 #3
0
				{
					Name: "some-other-job",
				},
			},
			Resources: atc.ResourceConfigs{
				{
					Name: "some-resource",
					Type: "some-type",
				},
			},
		}

		_, _, err = sqlDB.SaveConfig(team.Name, "a-pipeline-name", config, 0, db.PipelineUnpaused)
		Expect(err).NotTo(HaveOccurred())

		pipelineDB, err = pipelineDBFactory.BuildWithTeamNameAndName(team.Name, "a-pipeline-name")
		Expect(err).NotTo(HaveOccurred())
	})

	AfterEach(func() {
		err := dbConn.Close()
		Expect(err).NotTo(HaveOccurred())

		err = listener.Close()
		Expect(err).NotTo(HaveOccurred())
	})

	Context("GetResourceVersions", func() {
		var resource atc.ResourceConfig
		var versions []atc.Version
		var expectedVersions []db.SavedVersionedResource
コード例 #4
0
ファイル: db_config_test.go プロジェクト: pcfdev-forks/atc
		It("defaults to paused", func() {
			_, _, err := database.SaveConfig(team.Name, pipelineName, config, 0, db.PipelineNoChange)
			Expect(err).NotTo(HaveOccurred())

			pipeline, err := database.GetPipelineByTeamNameAndName(team.Name, pipelineName)
			Expect(err).NotTo(HaveOccurred())

			Expect(pipeline.Paused).To(BeTrue())
		})

		It("creates all of the resources from the pipeline in the database", func() {
			_, _, err := database.SaveConfig(team.Name, pipelineName, config, 0, db.PipelineNoChange)
			Expect(err).NotTo(HaveOccurred())

			pipelineDB, err := pipelineDBFactory.BuildWithTeamNameAndName(team.Name, pipelineName)
			Expect(err).NotTo(HaveOccurred())

			_, err = pipelineDB.GetResource("some-resource")
			Expect(err).NotTo(HaveOccurred())
		})

		It("creates all of the jobs from the pipeline in the database", func() {
			_, _, err := database.SaveConfig(team.Name, pipelineName, config, 0, db.PipelineNoChange)
			Expect(err).NotTo(HaveOccurred())

			pipelineDB, err := pipelineDBFactory.BuildWithTeamNameAndName(team.Name, pipelineName)
			Expect(err).NotTo(HaveOccurred())

			_, err = pipelineDB.GetJob("some-job")
			Expect(err).NotTo(HaveOccurred())