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

Terraform Test: Allow skipping cleanup of entire test file or individual run blocks #36729

Merged
merged 4 commits into from
Apr 2, 2025

Conversation

dsa0x
Copy link
Member

@dsa0x dsa0x commented Mar 20, 2025

Implements skip_cleanup, which allows skipping the cleanup of individual run blocks or the entire test file. This simply ensures that the cleanup stage for the state is an apply of the run requesting the skip, instead of the normal destroy

Target Release

1.12.x

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@SarahFrench SarahFrench requested a review from a team March 25, 2025 15:12
Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Left a few comments:

  • Some nit-like comments about how terminal output could make it clearer about whether cleanup is being skipped, and why.
  • A comment about some scenarios with conflicting skip_cleanup instructions that it might be useful to add tests for.

In the case of conflicting skip_cleanup instructions from run blocks versus the test block, should that cause a parsing error or should the test run and during cleanup users see a warning about the conflicting instructions?

Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

LGTM - skip_cleanup behaviour matches my expectations from the RFC and the only remaining task is docs, which we discussed would be in a subsequent PR

@dsa0x dsa0x merged commit d78eefd into f-controlling-destroys Apr 2, 2025
8 checks passed
@dsa0x dsa0x deleted the sams/test_skip_cleanup branch April 2, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants