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

all: Add deferred action testing support (plan checks, version check, and CLI options) #331

Merged
merged 12 commits into from
May 17, 2024

Conversation

austinvalle
Copy link
Member

@austinvalle austinvalle commented May 3, 2024

This PR adds a couple different things all towards supporting testing deferred actions:

@austinvalle austinvalle added the enhancement New feature or request label May 3, 2024
@austinvalle austinvalle added this to the v1.8.0 milestone May 3, 2024
@austinvalle austinvalle requested a review from a team as a code owner May 3, 2024 20:22
go.mod Outdated Show resolved Hide resolved
Copy link
Contributor

@SBGoods SBGoods left a comment

Choose a reason for hiding this comment

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

LGTM! Only one non-blocking question about a potential new check.


// ExpectNoDeferredChanges returns a plan check that asserts that there are no deffered changes
// for any resources in the plan.
func ExpectNoDeferredChanges() PlanCheck {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful to have a ExpectNoDeferredChange plan check assertion for a single resource?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question! Off the top of my head I can't think of a specific testing flow that would need a negative check like that.

My initial thought is that most tests would follow the general flow of testing a single resource:

  • Test step 1: Check a resource is causing a plan to be deferred
  • Test step 2: Check there are no more deferred changes (i.e. no more rounds needed)

I'm not sure if there is a workflow where a test may want to end before all deferred changes are satisfied, but maybe more provider developer usage will let us know if that'd be beneficial.

Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@austinvalle austinvalle merged commit cb1f2b6 into main May 17, 2024
32 checks passed
@austinvalle austinvalle deleted the av/dfa branch May 17, 2024 15:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants