Skip to content

Commit

Permalink
Add version retention period to Spanner database resource (#6141) (#1…
Browse files Browse the repository at this point in the history
…1982)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jun 29, 2022
1 parent 9dd5986 commit 792521c
Show file tree
Hide file tree
Showing 8 changed files with 422 additions and 32 deletions.
6 changes: 6 additions & 0 deletions .changelog/6141.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:enhancement
spanner: Added field `version_retention_period` to `google_spanner_database` resource
```
```release-note:enhancement
spanner: Fixed issue where `ddl` and `version_retention_period` could not be set when first creating `google_spanner_database` using POSTGRESQL
```
9 changes: 4 additions & 5 deletions google/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package google

import (
"context"
"fmt"
"io/ioutil"
"os"
"testing"
Expand Down Expand Up @@ -64,7 +63,7 @@ func TestConfigLoadAndValidate_accountFileJSONInvalid(t *testing.T) {

func TestAccConfigLoadValidate_credentials(t *testing.T) {
if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
testAccPreCheck(t)

Expand Down Expand Up @@ -92,7 +91,7 @@ func TestAccConfigLoadValidate_credentials(t *testing.T) {

func TestAccConfigLoadValidate_impersonated(t *testing.T) {
if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
testAccPreCheck(t)

Expand Down Expand Up @@ -122,7 +121,7 @@ func TestAccConfigLoadValidate_impersonated(t *testing.T) {

func TestAccConfigLoadValidate_accessTokenImpersonated(t *testing.T) {
if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
testAccPreCheck(t)

Expand Down Expand Up @@ -162,7 +161,7 @@ func TestAccConfigLoadValidate_accessTokenImpersonated(t *testing.T) {

func TestAccConfigLoadValidate_accessToken(t *testing.T) {
if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
testAccPreCheck(t)

Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func TestAccComputeDisk_imageDiffSuppressPublicVendorsFamilyNames(t *testing.T)
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}

config := getInitializedConfig(t)
Expand Down
24 changes: 12 additions & 12 deletions google/resource_compute_instance_migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAccComputeInstanceMigrateState(t *testing.T) {
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
cases := map[string]struct {
StateVersion int
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestAccComputeInstanceMigrateState_empty(t *testing.T) {
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
var is *terraform.InstanceState
var meta interface{}
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestAccComputeInstanceMigrateState_bootDisk(t *testing.T) {
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestAccComputeInstanceMigrateState_v4FixBootDisk(t *testing.T) {
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -285,7 +285,7 @@ func TestAccComputeInstanceMigrateState_attachedDiskFromSource(t *testing.T) {
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -366,7 +366,7 @@ func TestAccComputeInstanceMigrateState_v4FixAttachedDiskFromSource(t *testing.T
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -446,7 +446,7 @@ func TestAccComputeInstanceMigrateState_attachedDiskFromEncryptionKey(t *testing
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -515,7 +515,7 @@ func TestAccComputeInstanceMigrateState_v4FixAttachedDiskFromEncryptionKey(t *te
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -583,7 +583,7 @@ func TestAccComputeInstanceMigrateState_attachedDiskFromAutoDeleteAndImage(t *te
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -656,7 +656,7 @@ func TestAccComputeInstanceMigrateState_v4FixAttachedDiskFromAutoDeleteAndImage(
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -728,7 +728,7 @@ func TestAccComputeInstanceMigrateState_scratchDisk(t *testing.T) {
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down Expand Up @@ -794,7 +794,7 @@ func TestAccComputeInstanceMigrateState_v4FixScratchDisk(t *testing.T) {
t.Parallel()

if os.Getenv(TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Network access not allowed; use %s=1 to enable", TestEnvVar))
t.Skipf("Network access not allowed; use %s=1 to enable", TestEnvVar)
}
config := getInitializedConfig(t)
zone := "us-central1-f"
Expand Down
Loading

0 comments on commit 792521c

Please sign in to comment.