You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform-plugin-sdk/[email protected] enables the acceptance testing framework to passthrough the TF_LOG_CORE and TF_LOG_PROVIDER environment variables to its underlying terraform-exec handling and ultimately Terraform CLI. Acceptance testing is a little strange in terms of logging because the provider "under test" is being executed directly with its logs being controlled by the testing framework, rather than production where logs flow always through Terraform CLI. This means that setting just TF_LOG_PROVIDER during testing does not have the desired effect of controlling the provider under test logs anymore (it does, however, control external providers that still log through Terraform CLI).
Attempted solutions
TF_LOG_CORE=WARN TF_LOG_PROVIDER_XXX=TRACE go test
Proposal
Introduce additional environment variable handling into the root loggers that would allow provider logging to work the same in production and acceptance testing.
The following behaviors could be a good starting point:
terraform-plugin-log version
Use cases
terraform-plugin-sdk/[email protected] enables the acceptance testing framework to passthrough the
TF_LOG_CORE
andTF_LOG_PROVIDER
environment variables to its underlyingterraform-exec
handling and ultimately Terraform CLI. Acceptance testing is a little strange in terms of logging because the provider "under test" is being executed directly with its logs being controlled by the testing framework, rather than production where logs flow always through Terraform CLI. This means that setting justTF_LOG_PROVIDER
during testing does not have the desired effect of controlling the provider under test logs anymore (it does, however, control external providers that still log through Terraform CLI).Attempted solutions
TF_LOG_CORE=WARN TF_LOG_PROVIDER_XXX=TRACE go test
Proposal
Introduce additional environment variable handling into the root loggers that would allow provider logging to work the same in production and acceptance testing.
The following behaviors could be a good starting point:
References
The text was updated successfully, but these errors were encountered: