99 "log"
1010 "os"
1111 "testing"
12- "time"
1312
1413 "github.com/gruntwork-io/terratest/modules/terraform"
1514 "github.com/stretchr/testify/suite"
@@ -19,6 +18,7 @@ import (
1918type ECSFargateSuite struct {
2019 suite.Suite
2120 terraformOptions * terraform.Options
21+ testPrefix string
2222}
2323
2424// TestECSFargateSuite is the entry point for the test suite
@@ -31,10 +31,10 @@ func (s *ECSFargateSuite) SetupSuite() {
3131 log .Println ("Setting up test suite resources..." )
3232
3333 // All resources must be prefixed with terraform-test
34- testPrefix : = "terraform-test"
34+ s . testPrefix = "terraform-test"
3535 ciJobID := os .Getenv ("CI_JOB_ID" )
3636 if ciJobID != "" {
37- testPrefix = testPrefix + "-" + ciJobID
37+ s . testPrefix = s . testPrefix + "-" + ciJobID
3838 }
3939
4040 // Define the Terraform options for the suite
@@ -46,19 +46,20 @@ func (s *ECSFargateSuite) SetupSuite() {
4646 "dd_api_key" : "test-api-key" ,
4747 "dd_service" : "test-service" ,
4848 "dd_site" : "datadoghq.com" ,
49- "test_prefix" : testPrefix ,
49+ "test_prefix" : s . testPrefix ,
5050 },
5151 RetryableTerraformErrors : map [string ]string {
52- "couldn't find resource" : "ECS eventually consistent or task definition not yet propagated " ,
52+ "couldn't find resource" : "terratest could not find the resource " ,
5353 },
54- NoColor : true ,
55- MaxRetries : 2 ,
56- TimeBetweenRetries : 10 * time .Second ,
57- Lock : true ,
54+ // NoColor: true,
55+ // MaxRetries: 0 ,
56+ // TimeBetweenRetries: 10 * time.Second,
57+ // Lock: true,
5858 }
5959
6060 // Run terraform init and apply
61- terraform .InitAndApply (s .T (), s .terraformOptions )
61+ terraform .Init (s .T (), s .terraformOptions )
62+ terraform .Apply (s .T (), s .terraformOptions )
6263}
6364
6465// TearDownSuite is run once at the end of the test suite
0 commit comments