Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Run method on PulumiTest #50

Merged
merged 6 commits into from
Jan 9, 2024
Merged

Add new Run method on PulumiTest #50

merged 6 commits into from
Jan 9, 2024

Conversation

danielrbradley
Copy link
Member

Stacked on #49

CacheStackState caches the stack state from executing the run func. Subsequent calls will load the stack state from the cache.

  • If the cache does not exist, it will run the run func and cache the resulting stack state.
  • The run function is always executed in an isolated temp directory so it won't affect the original test.
  • The state exported from the run function (or cached from the previous run) is imported into the original test's stack.

Aside: Fix missing install and stack creation in convert and copy

  • Make convert and copy follow the same default behaviour as the main test constructor.
  • Add log when creating a stack.

pulumitest/cacheStackState.go Outdated Show resolved Hide resolved
pulumitest/cacheStackState.go Outdated Show resolved Hide resolved
- Make convert and copy follow the same default behaviour as the main test constructor.
- Add log when creating a stack.
`CacheStackState` caches the stack state from executing the `run` func. Subsequent calls will load the stack state from the cache.
- If the cache does not exist, it will run the `run` func and cache the resulting stack state.
- The `run` function is always executed in an isolated temp directory so it won't affect the original test.
- The state exported from the `run` function (or cached from the previous run) is imported into the original test's stack.
- Make caching an optional feature within `Run`.
- Fix bug in CopyToTempDir where options were not propagated.
- Re-use exists function from copy.go
@danielrbradley danielrbradley changed the title Add new CacheStackState method on PulumiTest Add new Run method on PulumiTest Jan 9, 2024
Copy link
Contributor

@thomas11 thomas11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo the comments

pulumitest/optrun/optrun.go Outdated Show resolved Hide resolved
pulumitest/run.go Outdated Show resolved Hide resolved
Fix docs and logs.
@danielrbradley danielrbradley merged commit 40ed8b8 into main Jan 9, 2024
1 check passed
@danielrbradley danielrbradley deleted the cache-stack-setup branch January 9, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants