Skip to content

Commit

Permalink
Update oracledatabase acceptance tests to use unique names with ofake…
Browse files Browse the repository at this point in the history
…- prefix (#12497) (#8851)

[upstream:b8fc96e619a677023191bb1ac2b867ce9a7b06d0]

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

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

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -60,8 +61,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 = "tf-test-my-instance%{random_suffix}"
display_name = "tf-test-my-instance%{random_suffix} displayname"
cloud_exadata_infrastructure_id = "%{cloud_exadata_infrastructure_id}"
display_name = "%{cloud_exadata_infrastructure_id} displayname"
location = "us-east4"
project = "%{project}"
properties {
Expand All @@ -79,9 +80,10 @@ func TestAccOracleDatabaseCloudExadataInfrastructure_oracledatabaseCloudExadataI
t.Parallel()

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

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -105,8 +107,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 = "tf-test-my-instance%{random_suffix}"
display_name = "tf-test-my-instance%{random_suffix} displayname"
cloud_exadata_infrastructure_id = "%{cloud_exadata_infrastructure_id}"
display_name = "%{cloud_exadata_infrastructure_id} displayname"
location = "us-east4"
project = "%{project}"
gcp_oracle_zone = "us-east4-b-r1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ func TestAccOracleDatabaseCloudVmCluster_oracledatabaseCloudVmclusterBasicExampl
t.Parallel()

context := map[string]interface{}{
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
"cloud_exadata_infrastructure_id": fmt.Sprintf("ofake-tf-test-exadata-for-vmcluster-basic-%s", acctest.RandString(t, 10)),
"cloud_vm_cluster_id": fmt.Sprintf("ofake-tf-test-vmcluster-basic-%s", acctest.RandString(t, 10)),
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -60,8 +62,8 @@ func TestAccOracleDatabaseCloudVmCluster_oracledatabaseCloudVmclusterBasicExampl
func testAccOracleDatabaseCloudVmCluster_oracledatabaseCloudVmclusterBasicExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_oracle_database_cloud_vm_cluster" "my_vmcluster"{
cloud_vm_cluster_id = "tf-test-my-instance%{random_suffix}"
display_name = "tf-test-my-instance%{random_suffix} displayname"
cloud_vm_cluster_id = "%{cloud_vm_cluster_id}"
display_name = "%{cloud_vm_cluster_id} displayname"
location = "us-east4"
project = "%{project}"
exadata_infrastructure = google_oracle_database_cloud_exadata_infrastructure.cloudExadataInfrastructures.id
Expand All @@ -80,8 +82,8 @@ resource "google_oracle_database_cloud_vm_cluster" "my_vmcluster"{
}
resource "google_oracle_database_cloud_exadata_infrastructure" "cloudExadataInfrastructures"{
cloud_exadata_infrastructure_id = "tf-test-my-exadata%{random_suffix}"
display_name = "tf-test-my-exadata%{random_suffix} displayname"
cloud_exadata_infrastructure_id = "%{cloud_exadata_infrastructure_id}"
display_name = "%{cloud_exadata_infrastructure_id} displayname"
location = "us-east4"
project = "%{project}"
properties {
Expand All @@ -104,9 +106,11 @@ func TestAccOracleDatabaseCloudVmCluster_oracledatabaseCloudVmclusterFullExample
t.Parallel()

context := map[string]interface{}{
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
"cloud_exadata_infrastructure_id": fmt.Sprintf("ofake-tf-test-exadata-for-vmcluster-full-%s", acctest.RandString(t, 10)),
"cloud_vm_cluster_id": fmt.Sprintf("ofake-tf-test-vmcluster-full-%s", acctest.RandString(t, 10)),
"deletion_protection": false,
"project": "oci-terraform-testing",
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -130,8 +134,8 @@ func TestAccOracleDatabaseCloudVmCluster_oracledatabaseCloudVmclusterFullExample
func testAccOracleDatabaseCloudVmCluster_oracledatabaseCloudVmclusterFullExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_oracle_database_cloud_vm_cluster" "my_vmcluster"{
cloud_vm_cluster_id = "tf-test-my-instance%{random_suffix}"
display_name = "tf-test-my-instance%{random_suffix} displayname"
cloud_vm_cluster_id = "%{cloud_vm_cluster_id}"
display_name = "%{cloud_vm_cluster_id} displayname"
location = "us-east4"
project = "%{project}"
exadata_infrastructure = google_oracle_database_cloud_exadata_infrastructure.cloudExadataInfrastructures.id
Expand Down Expand Up @@ -171,8 +175,8 @@ resource "google_oracle_database_cloud_vm_cluster" "my_vmcluster"{
}
resource "google_oracle_database_cloud_exadata_infrastructure" "cloudExadataInfrastructures"{
cloud_exadata_infrastructure_id = "tf-test-my-exadata%{random_suffix}"
display_name = "tf-test-my-exadata%{random_suffix} displayname"
cloud_exadata_infrastructure_id = "%{cloud_exadata_infrastructure_id}"
display_name = "%{cloud_exadata_infrastructure_id} displayname"
location = "us-east4"
project = "%{project}"
properties {
Expand Down

0 comments on commit 5ad8ce6

Please sign in to comment.