fix: resolve issue where verify incorrectly failed when run with multiple modules where any module didn't have verify test cases
@@ -141,7 +141,7 @@ func Process(configs parser.SkaffoldConfigSet, validateConfig Options) error {
func ProcessWithRunContext(ctx context.Context, runCtx *runcontext.RunContext) error {
var errs []error
errs = append(errs, validateDockerNetworkContainerExists(ctx, runCtx.Artifacts(), runCtx)...)
- errs = append(errs, validateVerifyTestsExistOnVerifyCommand(runCtx.DefaultPipeline().Verify, runCtx)...)
+ errs = append(errs, validateVerifyTestsExistOnVerifyCommand(runCtx)...)
errs = append(errs, validateLocationSetForCloudRun(runCtx)...)
if len(errs) == 0 {
@@ -411,8 +411,12 @@ func validateDockerNetworkMode(cfg *parser.SkaffoldConfigEntry, artifacts []*lat
}
// Validate that test cases exist when `verify` is called, otherwise Skaffold should error
-func validateVerifyTestsExistOnVerifyCommand(tcs []*latest.VerifyTestCase, runCtx *runcontext.RunContext) []error {
+func validateVerifyTestsExistOnVerifyCommand(runCtx *runcontext.RunContext) []error {
var errs []error
+ tcs := []*latest.VerifyTestCase{}
+ for _, pipeline := range runCtx.GetPipelines() {
+ tcs = append(tcs, pipeline.Verify...)
+ }
if len(tcs) == 0 && runCtx.Opts.Command == "verify" {
errs = append(errs, fmt.Errorf("verify command expects non-zero number of test cases"))
}
