@@ -7,6 +7,7 @@ package test
77
88import (
99 "log"
10+ "os"
1011 "testing"
1112
1213 "github.com/gruntwork-io/terratest/modules/terraform"
@@ -28,15 +29,23 @@ func TestECSFargateSuite(t *testing.T) {
2829func (s * ECSFargateSuite ) SetupSuite () {
2930 log .Println ("Setting up test suite resources..." )
3031
32+ // All resources must be prefixed with terraform-test
33+ testPrefix := "terraform-test"
34+ ciJobID := os .Getenv ("CI_JOB_ID" )
35+ if ciJobID != "" {
36+ testPrefix = testPrefix + "-" + ciJobID
37+ }
38+
3139 // Define the Terraform options for the suite
3240 s .terraformOptions = & terraform.Options {
3341 // Path to the smoke_tests directory
3442 TerraformDir : "../smoke_tests/ecs_fargate" ,
3543 // Variables to pass to the Terraform module
3644 Vars : map [string ]interface {}{
37- "dd_api_key" : "test-api-key" ,
38- "dd_service" : "test-service" ,
39- "dd_site" : "datadoghq.com" ,
45+ "dd_api_key" : "test-api-key" ,
46+ "dd_service" : "test-service" ,
47+ "dd_site" : "datadoghq.com" ,
48+ "test_prefix" : testPrefix ,
4049 },
4150 NoColor : true ,
4251 }
0 commit comments