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

gcs provider fixes #16865

Merged
merged 4 commits into from
Dec 7, 2017
Merged

gcs provider fixes #16865

merged 4 commits into from
Dec 7, 2017

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Dec 6, 2017

  • The backend was creating the bucket named in the configuration if it didn't exist. We don't allow other backends to do this, because these are not managed resources that terraform can control.
  • Have the test fixtures create their own buckets, so parallel tests don't collide, and leftover buckets don't cause future failures. This also properly removes test buckets regardless of contents.
  • Add a test that fails the condition that This change will fix the dobule lock issue when we use data.terrafo… #16852 was fixing. This is simply looking up a locked remote state, since a backend may need to take a lock to create a non-existent state. Reading an existing locked remote state should succeed.
  • Match the operation of the google provider, by accepting either a file path or contents for both credentials and GOOGLE_CREDENTIALS

The backend was creating bucket named in the configuration if it didn't
exist. We don't allow other backends to do this, because these are not
managed resources that terraform can control.
This creates a unique bucket name for each test, so that the tests in
parallel don't collide, and buckets left over from interrupted tests
don't cause future failures.

Also make sure that buckets are removed, regardless of content.
This should only happen when a state is loaded via the backend, as well
as a remote state.
Match the operation of the google provider, by accepting either a file
path or contents for both `credentials` and `GOOGLE_CREDENTIALS`
@jbardin
Copy link
Member Author

jbardin commented Dec 6, 2017

$ TF_ACC=1 go test -v 2>/dev/null
=== RUN   TestStateFile
=== RUN   TestRemoteClient
=== RUN   TestRemoteLocks
=== RUN   TestBackend
=== RUN   TestBackendWithPrefix
--- PASS: TestStateFile (0.00s)
--- PASS: TestRemoteClient (6.73s)
--- PASS: TestRemoteLocks (8.95s)
--- PASS: TestBackend (18.68s)
	backend_test.go:114: TestBackend: testing state locking for *gcs.gcsBackend
--- PASS: TestBackendWithPrefix (21.86s)
	backend_test.go:127: TestBackend: testing state locking for *gcs.gcsBackend
PASS

@jbardin
Copy link
Member Author

jbardin commented Dec 6, 2017

This also fixes #16803

@ghost
Copy link

ghost commented Apr 5, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants