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

Output of Finalized Test Configurations During Acceptance Testing #700

Closed
bflad opened this issue Feb 9, 2021 · 1 comment · Fixed by #1059
Closed

Output of Finalized Test Configurations During Acceptance Testing #700

bflad opened this issue Feb 9, 2021 · 1 comment · Fixed by #1059
Assignees
Labels
enhancement New feature or request subsystem/tests Issues and feature requests related to the testing framework.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Feb 9, 2021

SDK version

v2.4.2

Use-cases

This issue is created by request as part of a series of related acceptance test feature requests that will be cross-referenced to each other for discoverability.

Acceptance test configurations are currently implemented as Go string type. These configurations can become quite large, may be composed of multiple "layer" configurations built up in the Go code, and fmt.Sprintf() parameterized to simplify value substitutions across test steps. To aid in the debugging of these test configurations, it could be helpful for provider developers to see the "final" Terraform configuration and potentially work with it outside the context of the acceptance testing framework.

Attempted Solutions

None at the moment, since the temporary directory used by the binary acceptance testing framework (and therefore any potential state files) cannot be retained. Separate feature request for that incoming.

Proposal

Output the Config to the debug logging of the acceptance testing framework during each TestStep.

While adding the ability to retain the temporary directory would enable provider developers to get at this information eventually, it would require a lot more steps and knowing which saved plan occurred when.

References

@bflad bflad added enhancement New feature or request subsystem/tests Issues and feature requests related to the testing framework. labels Feb 9, 2021
@bflad bflad added this to the v2.23.0 milestone Sep 14, 2022
bflad added a commit that referenced this issue Sep 14, 2022
Reference: #700

For example:

```console
$ TF_ACC=1 TF_LOG=TRACE go test -count=1 -run='TestTest_TestStep_ExternalProviders_DifferentVersions' -v ./helper/resource
...
2022-09-13T22:40:05.009-0400 [TRACE] sdk.helper_resource: Setting Terraform configuration: test_name=TestTest_TestStep_ExternalProviders_DifferentVersions test_step_number=1 test_terraform_path=/opt/homebrew/bin/terraform test_working_directory=/var/folders/f3/2mhr8hkx72z9dllv0ry81zm40000gq/T/plugintest971555752
  test_terraform_config=
  |
  | terraform {
  |   required_providers {
  |     null = {
  |       source = "registry.terraform.io/hashicorp/null"
  |       version = "3.1.0"
  |     }
  |   }
  | }
  |
  | provider "null" {}
  |
...
```
@bflad bflad self-assigned this Sep 14, 2022
bflad added a commit that referenced this issue Sep 14, 2022
Reference: #700

For example:

```console
$ TF_ACC=1 TF_LOG=TRACE go test -count=1 -run='TestTest_TestStep_ExternalProviders_DifferentVersions' -v ./helper/resource
...
2022-09-13T22:40:05.009-0400 [TRACE] sdk.helper_resource: Setting Terraform configuration: test_name=TestTest_TestStep_ExternalProviders_DifferentVersions test_step_number=1 test_terraform_path=/opt/homebrew/bin/terraform test_working_directory=/var/folders/f3/2mhr8hkx72z9dllv0ry81zm40000gq/T/plugintest971555752
  test_terraform_config=
  |
  | terraform {
  |   required_providers {
  |     null = {
  |       source = "registry.terraform.io/hashicorp/null"
  |       version = "3.1.0"
  |     }
  |   }
  | }
  |
  | provider "null" {}
  |
...
```
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request subsystem/tests Issues and feature requests related to the testing framework.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant