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 ephemeral resource schema and lifecycle tests #283

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

austinvalle
Copy link
Member

@austinvalle austinvalle commented Nov 8, 2024

This PR introduces some smoke tests for ephemeral resources released in terraform-plugin-framework v1.13.0, which are available in Terraform v1.10.0-beta.

There is one known bug in Terraform core where ephemeral resources are invoked with unknown values, which should not happen (similar to data sources, which are skipped until all config values are known). I wrote a negative test here for us to update once the next Terraform core beta releases with the fix.

^^ This has been adjusted to a normal positive test in 046f43c now that we're running 1.10.0-rc1

TODOs left

This PR relies on in-progress work on a test echo provider from terraform-plugin-testing, so this PR won't be merged until that work is merged/released.

@austinvalle austinvalle added the enhancement New feature or request label Nov 8, 2024
@austinvalle austinvalle requested a review from a team as a code owner November 8, 2024 17:12
@austinvalle
Copy link
Member Author

austinvalle commented Nov 8, 2024

Heh, the deferred action tests are failing because we made the assumption that we'd only ever run tests on pre-releases that were alphas. We should probably create a more specific version check for usage here.

func TestDeferredActionResource_ProviderDeferral(t *testing.T) {
	resource.UnitTest(t, resource.TestCase{
		TerraformVersionChecks: []tfversion.TerraformVersionCheck{
			tfversion.SkipBelow(tfversion.Version1_9_0),
			// Beta is also pre-release, but doesn't have experiments (deferred actions) enabled 
			tfversion.SkipIfNotPrerelease(),
		},

@austinvalle
Copy link
Member Author

Heh, the deferred action tests are failing because we made the assumption that we'd only ever run tests on pre-releases that were alphas. We should probably create a more specific version check for usage here.

I opened hashicorp/terraform-plugin-testing#388 and merged it into the echoprovider branch that this PR is using. Both the echoprovider changes and the SkipIfNotAlpha changes should be released together 👍🏻

…rm-provider-corner into av/ephemeral-resources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants