mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-06 04:38:34 +00:00
Give warning for common error missing 'run' key
This commit is contained in:
@@ -58,7 +58,7 @@ func TestStage_Validate(t *testing.T) {
|
||||
},
|
||||
}
|
||||
validation.ErrorTag = "yaml"
|
||||
ErrEquals(t, "steps: (0: \"invalid\" is not a valid step type.).", s.Validate())
|
||||
ErrEquals(t, "steps: (0: \"invalid\" is not a valid step type, maybe you omitted the 'run' key.).", s.Validate())
|
||||
|
||||
// Empty steps should validate.
|
||||
Ok(t, (raw.Stage{}).Validate())
|
||||
|
||||
@@ -83,7 +83,7 @@ func (s Step) Validate() error {
|
||||
validStep := func(value interface{}) error {
|
||||
str := *value.(*string)
|
||||
if str != InitStepName && str != PlanStepName && str != ApplyStepName {
|
||||
return fmt.Errorf("%q is not a valid step type", str)
|
||||
return fmt.Errorf("%q is not a valid step type, maybe you omitted the 'run' key", str)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ func TestStep_Validate(t *testing.T) {
|
||||
input: raw.Step{
|
||||
Key: String("invalid"),
|
||||
},
|
||||
expErr: "\"invalid\" is not a valid step type",
|
||||
expErr: "\"invalid\" is not a valid step type, maybe you omitted the 'run' key",
|
||||
},
|
||||
{
|
||||
description: "multiple keys in map",
|
||||
|
||||
@@ -104,7 +104,7 @@ func TestWorkflow_Validate(t *testing.T) {
|
||||
},
|
||||
}
|
||||
validation.ErrorTag = "yaml"
|
||||
ErrEquals(t, "apply: (steps: (0: \"invalid\" is not a valid step type.).).", w.Validate())
|
||||
ErrEquals(t, "apply: (steps: (0: \"invalid\" is not a valid step type, maybe you omitted the 'run' key.).).", w.Validate())
|
||||
|
||||
// Unset keys should validate.
|
||||
Ok(t, (raw.Workflow{}).Validate())
|
||||
|
||||
Reference in New Issue
Block a user