Skip to content

Commit

Permalink
Temporarily skip VCS related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasslash committed May 10, 2024
1 parent 96b1b2f commit f3977d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/provider/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ func skipUnlessBeta(t *testing.T) {
}
}

// Temporarily skip a test that may be experiencing API errors. This method
// purposefully errors after the set date to remind contributors to remove this check
// and verify that the API errors are no longer occurring.
func skipUnlessAfterDate(t *testing.T, d time.Time) {
today := time.Now()
if today.After(d) {
t.Fatalf("This test was temporarily skipped and has now expired. Remove this check to run this test.")
} else {
t.Skipf("Temporarily skipping test due to external issues: %s", t.Name())
}
}

func enterpriseEnabled() bool {
return os.Getenv("ENABLE_TFE") == "1"
}
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ func TestConfigureEnvOrganization(t *testing.T) {
// The TFE Provider tests use these environment variables, which are set in the
// GitHub Action workflow file .github/workflows/ci.yml.
func testAccGithubPreCheck(t *testing.T) {
skipUnlessAfterDate(t, time.Date(2024, 5, 24, 0, 0, 0, 0, time.UTC))

if envGithubToken == "" {
t.Skip("Please set GITHUB_TOKEN to run this test")
}
Expand Down

0 comments on commit f3977d1

Please sign in to comment.