pulumi/pkg/engine/lifecycletest
Will Jones 79c5d97afa
Normalize URNs in `DeletedWith` references (#17666)
It's often the case that we want to move or rename resources in our
Pulumi programs. Doing so can result in a change in the resource's URN,
which means that Pulumi will, by default, see the move as a deletion of
the old resource and a creation of the new resource. We can tell Pulumi
that a resource has been renamed by using *aliases*, whereby a resource
can be annotated with its previous URNs. Pulumi will then use these URNs
in several places:

* When looking for a resource's previous state, Pulumi will try to find
it using the new URN first and any aliases second.
* When writing out a new snapshot, Pulumi will *normalize* all URNs
(e.g. those in provider, parent and dependency references) to remove
aliases and replace them with the new URNs they resolve to.

Alas, a familiar story presents itself in the second case -- Pulumi does
not currently normalize `DeletedWith` references. This can result in
snapshot integrity errors as Pulumi leaves stale references in the
snapshot before writing it. This commit addresses this omission, using
the now-preferred `GetAllDependencies` method introduced in #17320 to
hopefully stop this from happening again in this part of the codebase.

Fixes #17614
2024-11-05 13:27:11 +00:00
..
framework Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
fuzzing Normalize URNs in `DeletedWith` references (#17666) 2024-11-05 13:27:11 +00:00
testdata Normalize URNs in `DeletedWith` references (#17666) 2024-11-05 13:27:11 +00:00
README.md Support generating random fixtures in lifecycle tests (#17627) 2024-10-31 15:16:38 +00:00
alias_test.go Normalize URNs in `DeletedWith` references (#17666) 2024-11-05 13:27:11 +00:00
analyzer_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
continue_on_error_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
delete_before_replace_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
golang_sdk_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
import_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
loader_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
parameterized_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
pending_delete_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
pending_replace_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
provider_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
pulumi_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
refresh_legacy_diff_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
refresh_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
resource_reference_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
retain_on_delete_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
source_query_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
step_generator_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
target_test.go Spot skipped-create dependencies even when inputs don't change (#17633) 2024-10-30 16:17:30 +00:00
transformation_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00
update_plan_test.go Factor out the lifecycle testing framework (#17584) 2024-10-28 11:58:59 +00:00

README.md

(lifecycle-tests)=

Lifecycle tests

Lifecycle tests exercise the Pulumi engine and serve as a specification for the behaviours and interactions of the various features that define the lifecycle of a Pulumi program. This includes, but is not limited to:

  • The operation(s) being executed (up, preview, etc.) and the options passed to that operation (--target, --target-dependents, etc.).
  • The programs being executed -- their resources, invocations, and the various options that might be associated with them (parent, retainOnDelete, etc.).
  • The state of the program before and after operations are executed.

How and when to use