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 acceptance test for TF_VAR environment variable usage #58

Merged
merged 1 commit into from
Apr 15, 2022

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Apr 13, 2022

NOTE: This new acceptance test will fail until github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0 is released and this project's Go module is updated. Will rebase once that's done.

Reference: hashicorp/terraform-plugin-sdk#935

With github.com/hashicorp/terraform-plugin-sdk/v2@v2.13.0:

$ TF_ACC=1 go test -count=1 -run='TestAccFrameworkResourceUser_TF_VAR_Environment_Variable' -v ./internal/frameworkprovider/
=== RUN   TestAccFrameworkResourceUser_TF_VAR_Environment_Variable
    resource_user_test.go:117: Step 1/1 error: Error running pre-apply refresh: variable "framework_user_name" was required but not supplied
--- FAIL: TestAccFrameworkResourceUser_TF_VAR_Environment_Variable (0.56s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       1.324s
FAIL

Passes with hashicorp/terraform-plugin-sdk#937.

@bflad bflad requested a review from a team as a code owner April 13, 2022 16:52
@@ -109,6 +109,40 @@ func TestAccFrameworkResourceUser_interpolateLanguage(t *testing.T) {
})
}

// Reference: https://github.com/hashicorp/terraform-plugin-sdk/issues/935
func TestAccFrameworkResourceUser_TF_VAR_Environment_Variable(t *testing.T) {
expectedUserName := "Ford Prefect"
Copy link
Contributor

Choose a reason for hiding this comment

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

LOL - I see what you did there ;)

Reference: hashicorp/terraform-plugin-sdk#935

With github.com/hashicorp/terraform-plugin-sdk/v2@v2.13.0:

```console
$ TF_ACC=1 go test -count=1 -run='TestAccFrameworkResourceUser_TF_VAR_Environment_Variable' -v ./internal/frameworkprovider/
=== RUN   TestAccFrameworkResourceUser_TF_VAR_Environment_Variable
    resource_user_test.go:117: Step 1/1 error: Error running pre-apply refresh: variable "framework_user_name" was required but not supplied
--- FAIL: TestAccFrameworkResourceUser_TF_VAR_Environment_Variable (0.56s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       1.324s
FAIL
```

Passes with hashicorp/terraform-plugin-sdk#937.
@bflad bflad force-pushed the bflad-tfvar-usage branch from df9f402 to 0592d86 Compare April 15, 2022 16:53
@bflad
Copy link
Contributor Author

bflad commented Apr 15, 2022

Rebased after merging terraform-plugin-sdk update and all green, merging!

@bflad bflad merged commit 50c4eea into main Apr 15, 2022
@bflad bflad deleted the bflad-tfvar-usage branch April 15, 2022 17:32
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants