backend/remote-state/gcs: Require TF_ACC for tests using the network.

This commit is contained in:
Florian Forster 2017-10-04 08:50:58 +02:00 committed by James Bardin
parent 72ccf22a92
commit a84823f597
1 changed files with 4 additions and 4 deletions

View File

@ -112,14 +112,14 @@ func TestBackend(t *testing.T) {
}
// testBackend returns a new GCS backend.
// This creates a bucket in GCS and populates it. Since this may incur costs,
// it will only run if the GOOGLE_PROJECT environment variable is set.
func testBackend(t *testing.T) backend.Backend {
t.Helper()
projectID := os.Getenv("GOOGLE_PROJECT")
if projectID == "" {
t.Skip("skipping; set GOOGLE_PROJECT to activate")
if projectID == "" || os.Getenv("TF_ACC") == "" {
t.Skip("This test creates a bucket in GCS and populates it. " +
"Since this may incur costs, it will only run if " +
"the TF_ACC and GOOGLE_PROJECT environment variables are set.")
}
config := map[string]interface{}{