Skip to content

Commit

Permalink
tests/resource/aws_s3_bucket_object: Fix etag and non-versions test c…
Browse files Browse the repository at this point in the history
…onfigurations (#15225)

Previously:

```
=== CONT  TestAccAWSS3BucketObject_etagEncryption
TestAccAWSS3BucketObject_etagEncryption: resource_aws_s3_bucket_object_test.go:199: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Invalid expression
on config027201552/terraform_plugin_test.tf line 10, in resource "aws_s3_bucket_object" "object":
10:   source                 = %!q(int=5634537717392942380)
Expected the start of an expression, but found an invalid expression token.
Error: Missing argument separator
on config027201552/terraform_plugin_test.tf line 11, in resource "aws_s3_bucket_object" "object":
11:   etag                   = filemd5(%!q(int=5634537717392942380))
A comma is required to separate each function argument from the next.
--- FAIL: TestAccAWSS3BucketObject_etagEncryption (1.67s)

=== CONT  TestAccAWSS3BucketObject_NonVersioned
TestAccAWSS3BucketObject_NonVersioned: resource_aws_s3_bucket_object_test.go:272: Step 1/1 error: terraform failed: exit status 1
stderr:
Error: Invalid expression
on config020903983/terraform_plugin_test.tf line 16, in resource "aws_s3_bucket_object" "object":
16:   source = %!q(int=1805044611502807977)
Expected the start of an expression, but found an invalid expression token.
Error: Missing argument separator
on config020903983/terraform_plugin_test.tf line 17, in resource "aws_s3_bucket_object" "object":
17:   etag   = filemd5(%!q(int=1805044611502807977))
A comma is required to separate each function argument from the next.
--- FAIL: TestAccAWSS3BucketObject_NonVersioned (2.34s)
```

Output from acceptance testing:

```
--- PASS: TestAccAWSS3BucketObject_etagEncryption (23.09s)
--- PASS: TestAccAWSS3BucketObject_NonVersioned (23.34s)
```
  • Loading branch information
bflad authored Sep 23, 2020
1 parent 5deb6e3 commit 16c231f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions aws/resource_aws_s3_bucket_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1226,15 +1226,15 @@ resource "aws_s3_bucket_object" "object" {
func testAccAWSS3BucketObjectEtagEncryption(randInt int, source string) string {
return fmt.Sprintf(`
resource "aws_s3_bucket" "object_bucket" {
bucket = "tf-object-test-bucket-%d"
bucket = "tf-object-test-bucket-%[1]d"
}
resource "aws_s3_bucket_object" "object" {
bucket = aws_s3_bucket.object_bucket.bucket
key = "test-key"
server_side_encryption = "AES256"
source = %[1]q
etag = filemd5(%[1]q)
source = %[2]q
etag = filemd5(%[2]q)
}
`, randInt, source)
}
Expand Down Expand Up @@ -1566,14 +1566,14 @@ func testAccAWSS3BucketObjectConfig_NonVersioned(randInt int, source string) str

return testAccProviderConfigAssumeRolePolicy(policy) + fmt.Sprintf(`
resource "aws_s3_bucket" "object_bucket_3" {
bucket = "tf-object-test-bucket-%d"
bucket = "tf-object-test-bucket-%[1]d"
}
resource "aws_s3_bucket_object" "object" {
bucket = aws_s3_bucket.object_bucket_3.bucket
key = "updateable-key"
source = %[1]q
etag = filemd5(%[1]q)
source = %[2]q
etag = filemd5(%[2]q)
}
`, randInt, source)
}

0 comments on commit 16c231f

Please sign in to comment.