Exemple #1
0
						atc.Plan{
							ID: "25",
							Task: &atc.TaskPlan{
								Name:       "name",
								ConfigPath: "some/config/path.yml",
								Config: &atc.TaskConfig{
									Params: map[string]string{"some": "secret"},
								},
							},
						},
					},
				},
			},
		}

		json := plan.Public()
		Expect(json).ToNot(BeNil())
		Expect([]byte(*json)).To(MatchJSON(`{
  "id": "0",
  "aggregate": [
    {
      "id": "1",
      "aggregate": [
        {
          "id": "2",
          "task": {
            "name": "name",
            "privileged": false
          }
        }
      ]
Exemple #2
0
		JustBeforeEach(func() {
			publicPlan, planFound, publicPlanErr = build.PublicPlan(logger)
		})

		It("returns the plan successfully", func() {
			Expect(publicPlanErr).ToNot(HaveOccurred())
			Expect(planFound).To(BeTrue())
		})

		It("has the engine name as the schema", func() {
			Expect(publicPlan.Schema).To(Equal("exec.v2"))
		})

		It("cleans out sensitive/irrelevant information from the original plan", func() {
			Expect(publicPlan.Plan).To(Equal(plan.Public()))
		})
	})
})

func successResult(result exec.Success) func(dest interface{}) bool {
	return func(dest interface{}) bool {
		switch x := dest.(type) {
		case *exec.Success:
			*x = result
			return true

		default:
			return false
		}
	}