Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sql VCR test failure in replaying #4738

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/6625.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```release-note:none
```
17 changes: 11 additions & 6 deletions google-beta/resource_sql_database_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1275,13 +1275,16 @@ func TestAccSqlDatabaseInstance_SqlServerAuditConfig(t *testing.T) {
func TestAccSqlDatabaseInstance_mysqlMajorVersionUpgrade(t *testing.T) {
t.Parallel()

databaseName := "tf-test-" + randString(t, 10)

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccSqlDatabaseInstanceDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testGoogleSqlDatabaseInstance_basic2,
Config: fmt.Sprintf(
testGoogleSqlDatabaseInstance_basic3, databaseName),
},
{
ResourceName: "google_sql_database_instance.instance",
Expand All @@ -1290,7 +1293,8 @@ func TestAccSqlDatabaseInstance_mysqlMajorVersionUpgrade(t *testing.T) {
ImportStateVerifyIgnore: []string{"root_password", "deletion_protection"},
},
{
Config: testGoogleSqlDatabaseInstance_basic2_update,
Config: fmt.Sprintf(
testGoogleSqlDatabaseInstance_basic3_update, databaseName),
},
{
ResourceName: "google_sql_database_instance.instance",
Expand Down Expand Up @@ -1360,22 +1364,23 @@ resource "google_sql_database_instance" "instance" {
}
`

var testGoogleSqlDatabaseInstance_basic2_update = `
var testGoogleSqlDatabaseInstance_basic3 = `
resource "google_sql_database_instance" "instance" {
name = "%s"
region = "us-central1"
database_version = "MYSQL_8_0"
database_version = "MYSQL_5_7"
deletion_protection = false
settings {
tier = "db-f1-micro"
}
}
`

var testGoogleSqlDatabaseInstance_basic3 = `
var testGoogleSqlDatabaseInstance_basic3_update = `
resource "google_sql_database_instance" "instance" {
name = "%s"
region = "us-central1"
database_version = "MYSQL_5_7"
database_version = "MYSQL_8_0"
deletion_protection = false
settings {
tier = "db-f1-micro"
Expand Down