Fix test for missing creates

This commit is contained in:
Fraser Waters 2021-11-04 19:32:11 +00:00
parent f4c28053f8
commit 3e73c036fb

View file

@ -267,6 +267,16 @@ func (ex *deploymentExecutor) Execute(callerCtx context.Context, opts Options, p
res = ex.checkTargets(opts.UpdateTargets, OpUpdate)
}
// Check that we did operations for everything expected in the plan. We mutate ResourcePlan.Ops as we run
// so by the time we get here everything in the map should have an empty ops list
if ex.deployment.plan != nil {
for urn, resourcePlan := range ex.deployment.plan {
if len(resourcePlan.Ops) != 0 {
return nil, result.Errorf("Expected resource operations for %v but none were seen.", urn)
}
}
}
if res != nil && res.IsBail() {
return nil, res
}