Skip to content

Commit 5c2e8e4

Browse files
author
Shaun Verch
committed
Use t.Setenv so env vars are cleaned up
1 parent 1b79e4b commit 5c2e8e4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/terraform_aws_endpoint_example_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package test
22

33
import (
4-
"os"
54
"fmt"
65
"strings"
76
"testing"
@@ -14,13 +13,11 @@ import (
1413

1514
// An example of how to test the Terraform module in examples/terraform-aws-endpoint-example using Terratest.
1615
func TestTerraformAwsEndpointExample(t *testing.T) {
17-
t.Parallel()
18-
1916
// Set a custom endpoint for AWS, and set the keys to dummy keys to
2017
// pass that check
21-
os.Setenv("TERRATEST_CUSTOM_AWS_ENDPOINT", "http://localhost:5000")
22-
os.Setenv("AWS_ACCESS_KEY_ID", "dummy")
23-
os.Setenv("AWS_SECRET_ACCESS_KEY", "dummy")
18+
t.Setenv("TERRATEST_CUSTOM_AWS_ENDPOINT", "http://localhost:5000")
19+
t.Setenv("AWS_ACCESS_KEY_ID", "dummy")
20+
t.Setenv("AWS_SECRET_ACCESS_KEY", "dummy")
2421

2522
// Give this S3 Bucket a unique ID for a name tag so we can distinguish it from any other Buckets provisioned
2623
// in your AWS account

0 commit comments

Comments
 (0)