Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SKIP_PROJECT_SWEEPER env variable for skipping the project sweeper #7432

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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