`validatepipelinehelpers.Validate` no longer exits on some errors
Previously this method called displayhelpers.Failf() when errors were
encountered during parsing, or when warnings were encountered during
strict parsing. This made it impossible to test for validator behavior
during error conditions.
Now, this method simply returns an error.
part of fixing
package validatepipelinehelpers
import (
+ "errors"
"fmt"
+
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/configvalidate"
@@ -45,7 +47,7 @@ func Validate(yamlTemplate templatehelpers.YamlTemplateWithParams, strict bool,
}
if len(errorMessages) > 0 || (strict && len(warnings) > 0) {
- displayhelpers.Failf("configuration invalid")
+ return errors.New("configuration invalid")
}
if output {
