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

tests/s3: add dependency on aws_s3_bucket_versioning when configuring s3_object resources #23100

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Feb 10, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #22997
Relates #4418
Relates #20433

Tests in GovCloud can error with the following so tests have been updated to ensure versioning on the source S3 bucket is configured before creating an S3 object:

=== CONT  TestAccS3Object_tagsMultipleSlashes
    object_test.go:938: Step 2/4 error: Check failed: Check 2/8 error: Expected second object to have VersionId: {
          AcceptRanges: "bytes",
          Body: buffer(0xc0022bc080),
          ContentLength: 5,
          ContentType: "binary/octet-stream",
          ETag: "\"c13d88cb4cb02003daedb8a84e5d272a\"",
          LastModified: 2022-02-10 07:22:47 +0000 UTC,
          TagCount: 3
        }
--- FAIL: TestAccS3Object_tagsMultipleSlashes (132.07s)

Output from acceptance testing:

$ make testacc TESTS='TestAccS3Object_' PKG=s3 ACCTEST_PARALLELISM=5
--- PASS: TestAccS3Object_noNameNoKey (3.50s)
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithOn (67.34s)
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithNone (97.81s)
--- PASS: TestAccS3Object_acl (99.78s)
--- PASS: TestAccS3Object_tagsLeadingMultipleSlashes (126.21s)
--- PASS: TestAccS3Object_tagsMultipleSlashes (131.32s)
--- SKIP: TestAccS3Object_nonVersioned (0.00s)
--- PASS: TestAccS3Object_sse (30.16s)
--- PASS: TestAccS3Object_kms (34.20s)
--- PASS: TestAccS3Object_tagsLeadingSingleSlash (130.24s)
--- PASS: TestAccS3Object_metadata (80.71s)
--- PASS: TestAccS3Object_tags (131.99s)
--- PASS: TestAccS3Object_storageClass (134.20s)
--- PASS: TestAccS3Object_updatesWithVersioningViaAccessPoint (68.46s)
--- PASS: TestAccS3Object_bucketBucketKeyEnabled (30.37s)
--- PASS: TestAccS3Object_updatesWithVersioning (67.03s)
--- PASS: TestAccS3Object_updateSameFile (63.87s)
--- PASS: TestAccS3Object_defaultBucketSSE (30.32s)
--- PASS: TestAccS3Object_updates (66.83s)
--- PASS: TestAccS3Object_objectBucketKeyEnabled (28.25s)
--- PASS: TestAccS3Object_etagEncryption (30.26s)
--- PASS: TestAccS3Object_withContentCharacteristics (27.44s)
--- PASS: TestAccS3Object_ignoreTags (66.78s)
--- PASS: TestAccS3Object_contentBase64 (27.57s)
--- PASS: TestAccS3Object_source (30.01s)
--- PASS: TestAccS3Object_sourceHashTrigger (54.41s)
--- PASS: TestAccS3Object_objectLockRetentionStartWithSet (120.74s)
--- PASS: TestAccS3Object_objectLockRetentionStartWithNone (92.40s)
--- PASS: TestAccS3Object_content (30.03s)
--- PASS: TestAccS3Object_empty (29.79s)
 $ make testacc TESTS='TestAccS3ObjectDataSource' PKG=s3 ACCTEST_PARALLELISM=5
--- PASS: TestAccS3ObjectDataSource_singleSlashAsKey (30.33s)
--- PASS: TestAccS3ObjectDataSource_basic (32.68s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOff (39.40s)
--- PASS: TestAccS3ObjectDataSource_leadingSlash (56.81s)
--- PASS: TestAccS3ObjectDataSource_multipleSlashes (56.83s)
--- PASS: TestAccS3ObjectDataSource_kmsEncrypted (32.59s)
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOn (37.95s)
--- PASS: TestAccS3ObjectDataSource_allParams (39.10s)
--- PASS: TestAccS3ObjectDataSource_readableBody (31.96s)
--- PASS: TestAccS3ObjectDataSource_bucketKeyEnabled (32.96s)
--- PASS: TestAccS3ObjectDataSource_basicViaAccessPoint (30.44s)

@github-actions github-actions bot added service/s3 Issues and PRs that pertain to the s3 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/S Managed by automation to categorize the size of a PR. labels Feb 10, 2022
@anGie44 anGie44 marked this pull request as ready for review February 10, 2022 14:14
@anGie44 anGie44 requested a review from YakDriver February 10, 2022 14:14
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccS3ObjectDataSource_\|TestAccS3Object_' PKG=s3 ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 5  -run=TestAccS3ObjectDataSource_\|TestAccS3Object_ -timeout 180m
=== RUN   TestAccS3ObjectDataSource_basic
=== PAUSE TestAccS3ObjectDataSource_basic
=== RUN   TestAccS3ObjectDataSource_basicViaAccessPoint
=== PAUSE TestAccS3ObjectDataSource_basicViaAccessPoint
=== RUN   TestAccS3ObjectDataSource_readableBody
=== PAUSE TestAccS3ObjectDataSource_readableBody
=== RUN   TestAccS3ObjectDataSource_kmsEncrypted
=== PAUSE TestAccS3ObjectDataSource_kmsEncrypted
=== RUN   TestAccS3ObjectDataSource_bucketKeyEnabled
=== PAUSE TestAccS3ObjectDataSource_bucketKeyEnabled
=== RUN   TestAccS3ObjectDataSource_allParams
=== PAUSE TestAccS3ObjectDataSource_allParams
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOff
=== RUN   TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== PAUSE TestAccS3ObjectDataSource_objectLockLegalHoldOn
=== RUN   TestAccS3ObjectDataSource_leadingSlash
=== PAUSE TestAccS3ObjectDataSource_leadingSlash
=== RUN   TestAccS3ObjectDataSource_multipleSlashes
=== PAUSE TestAccS3ObjectDataSource_multipleSlashes
=== RUN   TestAccS3ObjectDataSource_singleSlashAsKey
=== PAUSE TestAccS3ObjectDataSource_singleSlashAsKey
=== RUN   TestAccS3Object_noNameNoKey
=== PAUSE TestAccS3Object_noNameNoKey
=== RUN   TestAccS3Object_empty
=== PAUSE TestAccS3Object_empty
=== RUN   TestAccS3Object_source
=== PAUSE TestAccS3Object_source
=== RUN   TestAccS3Object_content
=== PAUSE TestAccS3Object_content
=== RUN   TestAccS3Object_etagEncryption
=== PAUSE TestAccS3Object_etagEncryption
=== RUN   TestAccS3Object_contentBase64
=== PAUSE TestAccS3Object_contentBase64
=== RUN   TestAccS3Object_sourceHashTrigger
=== PAUSE TestAccS3Object_sourceHashTrigger
=== RUN   TestAccS3Object_withContentCharacteristics
=== PAUSE TestAccS3Object_withContentCharacteristics
=== RUN   TestAccS3Object_nonVersioned
=== PAUSE TestAccS3Object_nonVersioned
=== RUN   TestAccS3Object_updates
=== PAUSE TestAccS3Object_updates
=== RUN   TestAccS3Object_updateSameFile
=== PAUSE TestAccS3Object_updateSameFile
=== RUN   TestAccS3Object_updatesWithVersioning
=== PAUSE TestAccS3Object_updatesWithVersioning
=== RUN   TestAccS3Object_updatesWithVersioningViaAccessPoint
=== PAUSE TestAccS3Object_updatesWithVersioningViaAccessPoint
=== RUN   TestAccS3Object_kms
=== PAUSE TestAccS3Object_kms
=== RUN   TestAccS3Object_sse
=== PAUSE TestAccS3Object_sse
=== RUN   TestAccS3Object_acl
=== PAUSE TestAccS3Object_acl
=== RUN   TestAccS3Object_metadata
=== PAUSE TestAccS3Object_metadata
=== RUN   TestAccS3Object_storageClass
=== PAUSE TestAccS3Object_storageClass
=== RUN   TestAccS3Object_tags
=== PAUSE TestAccS3Object_tags
=== RUN   TestAccS3Object_tagsLeadingSingleSlash
=== PAUSE TestAccS3Object_tagsLeadingSingleSlash
=== RUN   TestAccS3Object_tagsLeadingMultipleSlashes
=== PAUSE TestAccS3Object_tagsLeadingMultipleSlashes
=== RUN   TestAccS3Object_tagsMultipleSlashes
=== PAUSE TestAccS3Object_tagsMultipleSlashes
=== RUN   TestAccS3Object_objectLockLegalHoldStartWithNone
=== PAUSE TestAccS3Object_objectLockLegalHoldStartWithNone
=== RUN   TestAccS3Object_objectLockLegalHoldStartWithOn
=== PAUSE TestAccS3Object_objectLockLegalHoldStartWithOn
=== RUN   TestAccS3Object_objectLockRetentionStartWithNone
=== PAUSE TestAccS3Object_objectLockRetentionStartWithNone
=== RUN   TestAccS3Object_objectLockRetentionStartWithSet
=== PAUSE TestAccS3Object_objectLockRetentionStartWithSet
=== RUN   TestAccS3Object_objectBucketKeyEnabled
=== PAUSE TestAccS3Object_objectBucketKeyEnabled
=== RUN   TestAccS3Object_bucketBucketKeyEnabled
=== PAUSE TestAccS3Object_bucketBucketKeyEnabled
=== RUN   TestAccS3Object_defaultBucketSSE
=== PAUSE TestAccS3Object_defaultBucketSSE
=== RUN   TestAccS3Object_ignoreTags
=== PAUSE TestAccS3Object_ignoreTags
=== CONT  TestAccS3ObjectDataSource_basic
=== CONT  TestAccS3Object_updateSameFile
=== CONT  TestAccS3Object_noNameNoKey
=== CONT  TestAccS3Object_ignoreTags
=== CONT  TestAccS3Object_defaultBucketSSE
--- PASS: TestAccS3Object_noNameNoKey (3.61s)
=== CONT  TestAccS3Object_bucketBucketKeyEnabled
--- PASS: TestAccS3ObjectDataSource_basic (38.19s)
=== CONT  TestAccS3Object_objectBucketKeyEnabled
--- PASS: TestAccS3Object_defaultBucketSSE (38.62s)
=== CONT  TestAccS3Object_objectLockRetentionStartWithSet
--- PASS: TestAccS3Object_bucketBucketKeyEnabled (35.76s)
=== CONT  TestAccS3Object_objectLockRetentionStartWithNone
--- PASS: TestAccS3Object_objectBucketKeyEnabled (34.32s)
=== CONT  TestAccS3Object_objectLockLegalHoldStartWithOn
--- PASS: TestAccS3Object_updateSameFile (77.10s)
=== CONT  TestAccS3Object_objectLockLegalHoldStartWithNone
--- PASS: TestAccS3Object_ignoreTags (79.37s)
=== CONT  TestAccS3Object_tagsMultipleSlashes
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithOn (74.00s)
=== CONT  TestAccS3Object_tagsLeadingMultipleSlashes
--- PASS: TestAccS3Object_objectLockRetentionStartWithNone (110.64s)
=== CONT  TestAccS3Object_tagsLeadingSingleSlash
--- PASS: TestAccS3Object_objectLockRetentionStartWithSet (144.89s)
=== CONT  TestAccS3Object_tags
--- PASS: TestAccS3Object_objectLockLegalHoldStartWithNone (111.39s)
=== CONT  TestAccS3Object_storageClass
--- PASS: TestAccS3Object_tagsMultipleSlashes (143.69s)
=== CONT  TestAccS3Object_metadata
--- PASS: TestAccS3Object_tagsLeadingMultipleSlashes (142.86s)
=== CONT  TestAccS3Object_acl
--- PASS: TestAccS3Object_tagsLeadingSingleSlash (145.25s)
=== CONT  TestAccS3Object_sse
--- PASS: TestAccS3Object_metadata (91.95s)
=== CONT  TestAccS3Object_kms
--- PASS: TestAccS3Object_tags (142.71s)
=== CONT  TestAccS3Object_updatesWithVersioningViaAccessPoint
--- PASS: TestAccS3Object_sse (35.14s)
=== CONT  TestAccS3Object_updatesWithVersioning
--- PASS: TestAccS3Object_storageClass (146.83s)
=== CONT  TestAccS3Object_contentBase64
--- PASS: TestAccS3Object_kms (36.31s)
=== CONT  TestAccS3Object_withContentCharacteristics
--- PASS: TestAccS3Object_contentBase64 (34.22s)
=== CONT  TestAccS3Object_sourceHashTrigger
--- PASS: TestAccS3Object_withContentCharacteristics (33.40s)
=== CONT  TestAccS3ObjectDataSource_kmsEncrypted
--- PASS: TestAccS3Object_updatesWithVersioningViaAccessPoint (78.37s)
=== CONT  TestAccS3ObjectDataSource_allParams
--- PASS: TestAccS3Object_acl (117.64s)
=== CONT  TestAccS3ObjectDataSource_bucketKeyEnabled
--- PASS: TestAccS3Object_updatesWithVersioning (79.56s)
=== CONT  TestAccS3Object_etagEncryption
--- PASS: TestAccS3ObjectDataSource_kmsEncrypted (39.90s)
=== CONT  TestAccS3Object_source
--- PASS: TestAccS3Object_sourceHashTrigger (65.00s)
=== CONT  TestAccS3ObjectDataSource_readableBody
--- PASS: TestAccS3Object_etagEncryption (36.07s)
=== CONT  TestAccS3ObjectDataSource_basicViaAccessPoint
--- PASS: TestAccS3ObjectDataSource_bucketKeyEnabled (39.77s)
=== CONT  TestAccS3Object_empty
--- PASS: TestAccS3ObjectDataSource_allParams (45.35s)
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOn
--- PASS: TestAccS3Object_source (35.72s)
=== CONT  TestAccS3Object_nonVersioned
    acctest.go:1143: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccS3Object_nonVersioned (0.00s)
=== CONT  TestAccS3Object_updates
--- PASS: TestAccS3ObjectDataSource_readableBody (36.78s)
=== CONT  TestAccS3ObjectDataSource_objectLockLegalHoldOff
--- PASS: TestAccS3Object_empty (35.11s)
=== CONT  TestAccS3ObjectDataSource_singleSlashAsKey
--- PASS: TestAccS3ObjectDataSource_basicViaAccessPoint (38.01s)
=== CONT  TestAccS3ObjectDataSource_multipleSlashes
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOn (47.18s)
=== CONT  TestAccS3ObjectDataSource_leadingSlash
--- PASS: TestAccS3ObjectDataSource_singleSlashAsKey (34.93s)
=== CONT  TestAccS3Object_content
--- PASS: TestAccS3ObjectDataSource_objectLockLegalHoldOff (46.77s)
--- PASS: TestAccS3Object_updates (80.06s)
--- PASS: TestAccS3ObjectDataSource_multipleSlashes (64.14s)
--- PASS: TestAccS3Object_content (35.37s)
--- PASS: TestAccS3ObjectDataSource_leadingSlash (62.66s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	563.656s

@anGie44 anGie44 merged commit 4d568f9 into main Feb 10, 2022
@anGie44 anGie44 deleted the td-s3-bucket-versioning-dependencies branch February 10, 2022 16:23
@anGie44 anGie44 added this to the v4.0.0 milestone Feb 10, 2022
@github-actions
Copy link

This functionality has been released in v4.0.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
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 issues.
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 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/s3 Issues and PRs that pertain to the s3 service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants