Skip to content

Commit

Permalink
Fix test `TestAccSecurityCenterManagementOrganizationEventThreatDetec…
Browse files Browse the repository at this point in the history
…tionCustomModule` (#11469) (#19205)

[upstream:bc5def9f8136003836911e78567dc8849a39be6d]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Aug 21, 2024
1 parent 08d0600 commit c76216d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .changelog/11469.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none
fixed tests for `google_scc_management_organization_event_threat_detection_custom_module` resource
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,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 @@ -16,8 +16,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 @@ -17,8 +17,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 @@ -18,8 +18,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 c76216d

Please sign in to comment.