Fix up tests

This commit is contained in:
Fraser Waters 2021-11-24 18:05:08 +00:00
parent 69d81638f9
commit f0ad8cffc7
3 changed files with 5 additions and 5 deletions

View file

@ -3305,7 +3305,7 @@ func TestPlannedPreviews(t *testing.T) {
},
})
p.Options.Plan = ClonePlan(t, plan)
validate := ExpectDiagMessage(t, "Expected resource operations for urn:pulumi:test::test::pkgA:m:typA::resA but none were seen.\n")
validate := ExpectDiagMessage(t, "<{%reset%}>resource violates plan: properties changed: -baz, -foo, -zed<{%reset%}>\n")
_, res = TestOp(Update).Plan(project, p.GetTarget(t, nil), p.Options, p.BackendClient, validate)
assert.Nil(t, res)

View file

@ -114,12 +114,12 @@ func (op TestOp) runWithContext(
plan, _, res := op(info, ctx, opts, dryRun)
contract.IgnoreClose(journal)
if dryRun {
return plan, nil, res
}
if validate != nil {
res = validate(project, target, journal.Entries(), firedEvents, res)
}
if dryRun {
return plan, nil, res
}
snap := journal.Snap(target.Snapshot)
if res == nil && snap != nil {

View file

@ -277,7 +277,7 @@ func (ex *deploymentExecutor) Execute(callerCtx context.Context, opts Options, p
// 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 (except for unneeded deletes)
if ex.deployment.plan != nil {
if res == nil && ex.deployment.plan != nil {
for urn, resourcePlan := range ex.deployment.plan.ResourcePlans {
if len(resourcePlan.Ops) != 0 {
if len(resourcePlan.Ops) == 1 && resourcePlan.Ops[0] == OpDelete {