示例#1
0
文件: tracker_test.go 项目: ACPK/atc
						It("chose the worker satisfying the resource type and tags", func() {
							Expect(workerClient.SatisfyingArgsForCall(0)).To(Equal(worker.WorkerSpec{
								ResourceType: "type1",
								Tags:         []string{"resource", "tags"},
							}))
						})

						It("located it on the correct worker", func() {
							Expect(cacheIdentifier.FindOnCallCount()).To(Equal(1))
							_, baggageclaimClient := cacheIdentifier.FindOnArgsForCall(0)
							Expect(baggageclaimClient).To(Equal(fakeBaggageclaimClient))
						})

						It("creates the container with the cache volume", func() {
							_, id, spec := satisfyingWorker.CreateContainerArgsForCall(0)

							Expect(id).To(Equal(session.ID))
							resourceSpec := spec.(worker.ResourceTypeContainerSpec)

							Expect(resourceSpec.Type).To(Equal(string(initType)))
							Expect(resourceSpec.Env).To(Equal([]string{"a=1", "b=2"}))
							Expect(resourceSpec.Ephemeral).To(Equal(true))
							Expect(resourceSpec.Tags).To(ConsistOf("resource", "tags"))
							Expect(resourceSpec.Cache).To(Equal(worker.VolumeMount{
								Volume:    foundVolume,
								MountPath: "/tmp/build/get",
							}))
						})

						It("saves the volume information to the database", func() {