pulumi/pkg/engine/lifecycletest
Will Jones c496921d44
Enable some more linting rules (#17456)
Issue #10659 lists a number of extra linting checks that we could enable
in order to make our Go code more robust. This commit implements as many
as seem sensible:

* `durationcheck`, which checks for multiplication of `time.Duration`s,
which can lead to unexpected behaviour (e.g. `time.Second * time.Second`
is *not* one second)
* `goprintffuncname`, which checks that `Printf`-like functions are
appropriately suffixed with `f` to indicate as such
* `tenv`, which checks for `os.Setenv` in tests where `t.Setenv` is
generally a better solution
* `wastedassign`, which checks for assignments whose values are never
used (such as initial values before an `if` where both branches then
overwrite the value)
* `whitespace`, which checks for blank lines at the beginning and end of
blocks such as functions, `if`s, `for`s and so on.

This commit does *not* enable the following checks listed in #10659:

* `wrapcheck`, which insists that third-party library errors are always
`%w`rapped -- we have a lot of cases where we don't do this and it's
probably a bit more involved than "just wrap them" in terms of making
sure we don't break anything (maybe)
* `predeclared`, which checks for shadowing of existing Go identifiers
-- we use `old` and `new` a lot, especially in step generation, so this
is probably a slightly bigger clean-up/one we might want to opt out of
* `mnd` (magic number detection) -- we have a lot of failures on this
* `nilnil` -- we only have a couple of failures on this; these could
probably be handled with `//nolint` but for now I've opted not to take
this route.
2024-10-03 17:37:13 +00:00
..
testdata Add a lifecycle test to show that ImportID works with parameterized providers (#17366) 2024-09-25 19:51:02 +00:00
README.md Document testing in `pulumi/pulumi` (#17161) 2024-09-05 11:51:32 +00:00
alias_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
analyzer_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
continue_on_error_test.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
delete_before_replace_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
golang_sdk_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
import_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
loader_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
parameterized_test.go Add a lifecycle test to show that ImportID works with parameterized providers (#17366) 2024-09-25 19:51:02 +00:00
pending_delete_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
pending_replace_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
provider_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
pulumi_test.go create unknowns when the provider is not known during construct (#16868) 2024-08-19 07:47:31 +00:00
refresh_legacy_diff_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
refresh_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
resource_reference_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
retain_on_delete_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
source_query_test.go Add parameterized `Call` support to the engine (#16813) 2024-07-26 15:36:53 +00:00
step_generator_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
target_test.go Fix dependency traversal for untargeted skipped creates (#17340) 2024-09-23 15:02:37 +00:00
test_plan.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
transformation_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
update_plan_test.go chore: fix some function names (#17128) 2024-09-03 08:57:30 +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