Skip to content

Commit

Permalink
Merge pull request #1479 from wakeful/fix-1478-aws-rds-tests
Browse files Browse the repository at this point in the history
fix #1478 we should copy the TF module into a temporary directory before running tests in parallel
  • Loading branch information
james03160927 authored Dec 9, 2024
2 parents 6c46211 + 0c9113c commit 485b3e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/terraform_aws_rds_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/gruntwork-io/terratest/modules/random"
"github.com/gruntwork-io/terratest/modules/terraform"
test_structure "github.com/gruntwork-io/terratest/modules/test-structure"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -75,12 +76,13 @@ func TestTerraformAwsRdsExample(t *testing.T) {
awsRegion := aws.GetRandomStableRegion(t, nil, nil)
engineVersion := aws.GetValidEngineVersion(t, awsRegion, tt.engineName, tt.majorEngineVersion)
instanceType := aws.GetRecommendedRdsInstanceType(t, awsRegion, tt.engineName, engineVersion, []string{"db.t2.micro", "db.t3.micro", "db.t3.small"})
moduleFolder := test_structure.CopyTerraformFolderToTemp(t, "../", "examples/terraform-aws-rds-example")

// Construct the terraform options with default retryable errors to handle the most common retryable errors in
// terraform testing.
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
// The path to where our Terraform code is located
TerraformDir: "../examples/terraform-aws-rds-example",
TerraformDir: moduleFolder,

// Variables to pass to our Terraform code using -var options
// "username" and "password" should not be passed from here in a production scenario.
Expand Down

0 comments on commit 485b3e0

Please sign in to comment.