コード例 #1
0
ファイル: resources_test.go プロジェクト: ACPK/atc
			Expect(pipelineDBFactory.BuildWithNameCallCount()).To(Equal(1))
			pipelineName := pipelineDBFactory.BuildWithNameArgsForCall(0)
			Expect(pipelineName).To(Equal("a-pipeline"))
		})

		Context("when getting the resource config succeeds", func() {
			BeforeEach(func() {
				pipelineDB.GetConfigReturns(atc.Config{
					Groups: []atc.GroupConfig{
						{
							Name:      "group-1",
							Resources: []string{"resource-1"},
						},
						{
							Name:      "group-2",
							Resources: []string{"resource-1", "resource-2"},
						},
					},

					Resources: []atc.ResourceConfig{
						{Name: "resource-1", Type: "type-1"},
						{Name: "resource-2", Type: "type-2"},
						{Name: "resource-3", Type: "type-3"},
					},
				}, 1, true, nil)
			})

			Context("when getting the check error succeeds", func() {
				BeforeEach(func() {
					pipelineDB.GetResourceStub = func(name string) (db.SavedResource, error) {
						if name == "resource-2" {
							return db.SavedResource{
コード例 #2
0
ファイル: runner_test.go プロジェクト: utako/atc
					Name:   "some-resource",
					Type:   "git",
					Source: atc.Source{"uri": "git://some-resource"},
				},
				{
					Name:   "some-dependant-resource",
					Type:   "git",
					Source: atc.Source{"uri": "git://some-dependant-resource"},
				},
			},
		}

		pipelineDB.ScopedNameStub = func(thing string) string {
			return "pipeline:" + thing
		}
		pipelineDB.GetConfigReturns(initialConfig, 1, nil)

		lock = new(dbfakes.FakeLock)
		locker.AcquireWriteLockImmediatelyReturns(lock, nil)
	})

	JustBeforeEach(func() {
		process = ginkgomon.Invoke(&Runner{
			Logger:    lagertest.NewTestLogger("test"),
			Locker:    locker,
			DB:        pipelineDB,
			Scheduler: scheduler,
			Noop:      noop,
			Interval:  100 * time.Millisecond,
		})
	})
コード例 #3
0
ファイル: jobs_test.go プロジェクト: pcfdev-forks/atc
				pipelineDB.GetConfigReturns(atc.Config{
					Groups: []atc.GroupConfig{
						{
							Name: "group-1",
							Jobs: []string{"some-job"},
						},
						{
							Name: "group-2",
							Jobs: []string{"some-job"},
						},
					},

					Jobs: []atc.JobConfig{
						{
							Name: "some-job",
							Plan: atc.PlanSequence{
								{
									Get: "some-input",
								},
								{
									Get:      "some-name",
									Resource: "some-other-input",
									Params:   atc.Params{"secret": "params"},
									Passed:   []string{"a", "b"},
									Trigger:  true,
								},
								{
									Put: "some-output",
								},
								{
									Put:    "some-other-output",
									Params: atc.Params{"secret": "params"},
								},
							},
						},
					},
				}, 1, true, nil)
コード例 #4
0
ファイル: jobs_test.go プロジェクト: utako/atc
				pipelineDB.GetConfigReturns(atc.Config{
					Groups: []atc.GroupConfig{
						{
							Name: "group-1",
							Jobs: []string{"some-job"},
						},
						{
							Name: "group-2",
							Jobs: []string{"some-job"},
						},
					},

					Jobs: []atc.JobConfig{
						{
							Name: "some-job",
							InputConfigs: []atc.JobInputConfig{
								{
									Resource: "some-input",
								},
								{
									RawName:  "some-name",
									Resource: "some-other-input",
									Params:   atc.Params{"secret": "params"},
									Passed:   []string{"a", "b"},
									Trigger:  true,
								},
							},
							OutputConfigs: []atc.JobOutputConfig{
								{
									Resource: "some-output",
								},
								{
									Resource:     "some-other-output",
									Params:       atc.Params{"secret": "params"},
									RawPerformOn: []atc.Condition{"failure"},
								},
							},
						},
					},
				}, 1, nil)