Skip to content

Commit

Permalink
Add SKIP_PROJECT_SWEEPER env variable for skipping the project sweeper (
Browse files Browse the repository at this point in the history
  • Loading branch information
roaks3 authored and ericayyliu committed Jul 26, 2023
1 parent 12578b7 commit 82d172e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mmv1/third_party/terraform/tests/resource_google_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ var (
)

func init() {
// SKIP_PROJECT_SWEEPER can be set for a sweeper run to prevent it from
// sweeping projects. This can be useful when running sweepers in
// organizations where acceptance tests intiated by another project may
// already be in-progress.
// Example: SKIP_PROJECT_SWEEPER=1 go test ./google -v -sweep=us-central1 -sweep-run=
if os.Getenv("SKIP_PROJECT_SWEEPER") != "" {
log.Printf("[INFO][SWEEPER_LOG] skipping the project sweeper because SKIP_PROJECT_SWEEPER is set")
return
}

resource.AddTestSweepers("GoogleProject", &resource.Sweeper{
Name: "GoogleProject",
F: testSweepProject,
Expand Down

0 comments on commit 82d172e

Please sign in to comment.