Skip to content

Commit

Permalink
Make google_oracle_database_autonomous_database and `google_oracle_…
Browse files Browse the repository at this point in the history
…database_cloud_exadata_infrastructure` generated tests use sweepable unique resource names (hashicorp#12476) (hashicorp#20569)

[upstream:c307c762769c34227812e5090f7ed0c6a2dedc4e]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Dec 3, 2024
1 parent d46fefc commit dad1fca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .changelog/12476.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 @@ -34,10 +34,9 @@ func TestAccOracleDatabaseAutonomousDatabase_oracledatabaseAutonomousDatabaseBas
t.Parallel()

context := map[string]interface{}{
"autonomous_database_id": "my-adb-instance-id",
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -61,7 +60,7 @@ func TestAccOracleDatabaseAutonomousDatabase_oracledatabaseAutonomousDatabaseBas
func testAccOracleDatabaseAutonomousDatabase_oracledatabaseAutonomousDatabaseBasicExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_oracle_database_autonomous_database" "myADB"{
autonomous_database_id = "%{autonomous_database_id}"
autonomous_database_id = "tf-test-my-instance%{random_suffix}"
location = "us-east4"
project = "%{project}"
database = "testdb"
Expand Down Expand Up @@ -89,10 +88,9 @@ func TestAccOracleDatabaseAutonomousDatabase_oracledatabaseAutonomousDatabaseFul
t.Parallel()

context := map[string]interface{}{
"autonomous_database_id": "my-adb-instance-id-2",
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -116,7 +114,7 @@ func TestAccOracleDatabaseAutonomousDatabase_oracledatabaseAutonomousDatabaseFul
func testAccOracleDatabaseAutonomousDatabase_oracledatabaseAutonomousDatabaseFullExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_oracle_database_autonomous_database" "myADB"{
autonomous_database_id = "%{autonomous_database_id}"
autonomous_database_id = "tf-test-my-instance%{random_suffix}"
location = "us-east4"
project = "%{project}"
display_name = "autonomousDatabase displayname"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ func TestAccOracleDatabaseCloudExadataInfrastructure_oracledatabaseCloudExadataI
t.Parallel()

context := map[string]interface{}{
"cloud_exadata_infrastructure_id": "ofake-exadata-basic",
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -61,8 +60,8 @@ func TestAccOracleDatabaseCloudExadataInfrastructure_oracledatabaseCloudExadataI
func testAccOracleDatabaseCloudExadataInfrastructure_oracledatabaseCloudExadataInfrastructureBasicExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_oracle_database_cloud_exadata_infrastructure" "my-cloud-exadata"{
cloud_exadata_infrastructure_id = "%{cloud_exadata_infrastructure_id}"
display_name = "%{cloud_exadata_infrastructure_id} displayname"
cloud_exadata_infrastructure_id = "tf-test-my-instance%{random_suffix}"
display_name = "tf-test-my-instance%{random_suffix} displayname"
location = "us-east4"
project = "%{project}"
properties {
Expand All @@ -80,10 +79,9 @@ func TestAccOracleDatabaseCloudExadataInfrastructure_oracledatabaseCloudExadataI
t.Parallel()

context := map[string]interface{}{
"cloud_exadata_infrastructure_id": "ofake-exadata-full",
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -107,8 +105,8 @@ func TestAccOracleDatabaseCloudExadataInfrastructure_oracledatabaseCloudExadataI
func testAccOracleDatabaseCloudExadataInfrastructure_oracledatabaseCloudExadataInfrastructureFullExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_oracle_database_cloud_exadata_infrastructure" "my-cloud-exadata"{
cloud_exadata_infrastructure_id = "%{cloud_exadata_infrastructure_id}"
display_name = "%{cloud_exadata_infrastructure_id} displayname"
cloud_exadata_infrastructure_id = "tf-test-my-instance%{random_suffix}"
display_name = "tf-test-my-instance%{random_suffix} displayname"
location = "us-east4"
project = "%{project}"
gcp_oracle_zone = "us-east4-b-r1"
Expand Down

0 comments on commit dad1fca

Please sign in to comment.