Skip to content

Commit

Permalink
Made filestore backup tests use sweepable resources (#13009) (#21317)
Browse files Browse the repository at this point in the history
[upstream:37390d359c66e0c8c4917fe8a4be1d5dab6440c2]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Feb 7, 2025
1 parent 76e2d83 commit e12bb4c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .changelog/13009.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestAccFilestoreBackup_filestoreBackupBasicExample(t *testing.T) {
func testAccFilestoreBackup_filestoreBackupBasicExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_filestore_instance" "instance" {
name = "tf-test-tf-fs-inst%{random_suffix}"
name = "tf-test-fs-inst%{random_suffix}"
location = "us-central1-b"
tier = "BASIC_HDD"
Expand All @@ -75,7 +75,7 @@ resource "google_filestore_instance" "instance" {
}
resource "google_filestore_backup" "backup" {
name = "tf-test-tf-fs-bkup%{random_suffix}"
name = "tf-test-fs-bkup%{random_suffix}"
location = "us-central1"
description = "This is a filestore backup for the test instance"
source_instance = google_filestore_instance.instance.id
Expand Down
8 changes: 4 additions & 4 deletions google/services/filestore/resource_filestore_backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
func TestAccFilestoreBackup_update(t *testing.T) {
t.Parallel()

instName := fmt.Sprintf("tf-fs-inst-%d", acctest.RandInt(t))
bkupName := fmt.Sprintf("tf-fs-bkup-%d", acctest.RandInt(t))
instName := fmt.Sprintf("tf-test-fs-inst-%d", acctest.RandInt(t))
bkupName := fmt.Sprintf("tf-test-fs-bkup-%d", acctest.RandInt(t))

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
Expand Down Expand Up @@ -121,8 +121,8 @@ func TestAccFilestoreBackup_tags(t *testing.T) {
t.Parallel()

org := envvar.GetTestOrgFromEnv(t)
instanceName := fmt.Sprintf("tf-fs-inst-%d", acctest.RandInt(t))
backupName := fmt.Sprintf("tf-fs-bkup-%d", acctest.RandInt(t))
instanceName := fmt.Sprintf("tf-test-fs-inst-%d", acctest.RandInt(t))
backupName := fmt.Sprintf("tf-test-fs-bkup-%d", acctest.RandInt(t))
tagKey := acctest.BootstrapSharedTestTagKey(t, "filestore-backups-tagkey")
tagValue := acctest.BootstrapSharedTestTagValue(t, "filestore-backups-tagvalue", tagKey)

Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/filestore_backup.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To get more information about Backup, see:

```hcl
resource "google_filestore_instance" "instance" {
name = "tf-fs-inst"
name = "fs-inst"
location = "us-central1-b"
tier = "BASIC_HDD"
Expand All @@ -56,7 +56,7 @@ resource "google_filestore_instance" "instance" {
}
resource "google_filestore_backup" "backup" {
name = "tf-fs-bkup"
name = "fs-bkup"
location = "us-central1"
description = "This is a filestore backup for the test instance"
source_instance = google_filestore_instance.instance.id
Expand Down

0 comments on commit e12bb4c

Please sign in to comment.