Skip to content

Commit

Permalink
Fix test `TestAccSecurityCenterManagementOrganizationEventThreatDetec…
Browse files Browse the repository at this point in the history
…tionCustomModule` (#11469)
  • Loading branch information
thokalavinod authored Aug 21, 2024
1 parent cec6d62 commit bc5def9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import (

// Custom Module tests cannot be run in parallel without running into 409 Conflict reponses.
// Run them as individual steps of an update test instead.
func TestAccSecurityCenterManagementFolderSecurityHealthAnalyticsCustomModule(t *testing.T) {
t.Parallel()
func testAccSecurityCenterManagementFolderSecurityHealthAnalyticsCustomModule(t *testing.T) {

context := map[string]interface{}{
"org_id": envvar.GetTestOrgFromEnv(t),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,28 @@ import (
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
)

func TestAccSecurityCenterManagementOrganizationEventThreatDetectionCustomModule(t *testing.T) {
t.Parallel()
func TestAccSecurityCenterManagement(t *testing.T) {
testCases := map[string]func(t *testing.T){
"orgSecurity": testAccSecurityCenterManagementOrganizationSecurityHealthAnalyticsCustomModule,
"folderSecurity": testAccSecurityCenterManagementFolderSecurityHealthAnalyticsCustomModule,
"projectSecurity": testAccSecurityCenterManagementProjectSecurityHealthAnalyticsCustomModule,
"organization": testAccSecurityCenterManagementOrganizationEventThreatDetectionCustomModule,
}

for name, tc := range testCases {
// shadow the tc variable into scope so that when
// the loop continues, if t.Run hasn't executed tc(t)
// yet, we don't have a race condition
// see https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
tc := tc
t.Run(name, func(t *testing.T) {
tc(t)
})
}
}

func testAccSecurityCenterManagementOrganizationEventThreatDetectionCustomModule(t *testing.T) {
// t.Parallel()

context := map[string]interface{}{
"org_id": envvar.GetTestOrgFromEnv(t),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import (

// Custom Module tests cannot be run in parallel without running into 409 Conflict reponses.
// Run them as individual steps of an update test instead.
func TestAccSecurityCenterManagementProjectSecurityHealthAnalyticsCustomModule(t *testing.T) {
t.Parallel()
func testAccSecurityCenterManagementProjectSecurityHealthAnalyticsCustomModule(t *testing.T) {

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import (

// Custom Module tests cannot be run in parallel without running into 409 Conflict reponses.
// Run them as individual steps of an update test instead.
func TestAccSecurityCenterManagementOrganizationSecurityHealthAnalyticsCustomModule(t *testing.T) {
t.Parallel()
func testAccSecurityCenterManagementOrganizationSecurityHealthAnalyticsCustomModule(t *testing.T) {

context := map[string]interface{}{
"org_id": envvar.GetTestOrgFromEnv(t),
Expand Down

0 comments on commit bc5def9

Please sign in to comment.