Skip to content

Conversation

SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Aug 27, 2025

Fixes an issue with how a test is constructed following #37430

After that PR, the returned error is now the result of calling [tfdiags.Diagnostics].Err() to get an error representation of a diagnostic. This meant the types had changed and interfered with the error comparison code in the test.

At the time I made changes in the Workspaces method this issue was lost amongst the diags comparison issues that are affecting the S3 backends' tests. I'm currently addressing those in a separate PR.

Target Release

N/A

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Aug 27, 2025
@SarahFrench
Copy link
Member Author

The test passes when I run it locally:

=== RUN   TestBackendWrongRegion
    backend_test.go:2979: TestBackendConfig on *s3.Backend with configtesting.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("terraform-remote-s3-test-68af493f"), "encrypt":cty.True, "key":cty.StringVal("testState"), "region":cty.StringVal("us-east-1")}}
    backend_test.go:2986: creating S3 bucket terraform-remote-s3-test-68af493f in us-west-1
--- PASS: TestBackendWrongRegion (2.66s)
PASS

@SarahFrench SarahFrench marked this pull request as ready for review August 27, 2025 18:07
@SarahFrench SarahFrench requested review from a team as code owners August 27, 2025 18:07
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

% TF_ACC=1 go test -count=1 ./... -run=TestBackendWrongRegion
ok      github.com/hashicorp/terraform/internal/backend/remote-state/s3 2.116s

@SarahFrench SarahFrench merged commit 865a0eb into main Aug 27, 2025
20 of 21 checks passed
@SarahFrench SarahFrench deleted the SarahFrench-patch-1 branch August 27, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/s3 no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants