backend/remote-state/gcs: Require TF_ACC for tests using the network.
This commit is contained in:
parent
72ccf22a92
commit
a84823f597
|
@ -112,14 +112,14 @@ func TestBackend(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// testBackend returns a new GCS backend.
|
// 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 {
|
func testBackend(t *testing.T) backend.Backend {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
projectID := os.Getenv("GOOGLE_PROJECT")
|
projectID := os.Getenv("GOOGLE_PROJECT")
|
||||||
if projectID == "" {
|
if projectID == "" || os.Getenv("TF_ACC") == "" {
|
||||||
t.Skip("skipping; set GOOGLE_PROJECT to activate")
|
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{}{
|
config := map[string]interface{}{
|
||||||
|
|
Loading…
Reference in New Issue