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

azurerm_mssql_database: Fix error with OnlineSecondary with auditing on Primary #14192

Conversation

aristosvo
Copy link
Collaborator

Fixes #14176

No AccTests specified, not sure if that would be necessary, happy to add if necessary

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great but a test would be perfect 🙈

@github-actions github-actions bot added size/M and removed size/XS labels Nov 15, 2021
@aristosvo
Copy link
Collaborator Author

aristosvo commented Nov 15, 2021

@mbfrahry Here they are! 🚀

TF_ACC=1 go test -v ./internal/services/mssql -run=TestAccMsSqlDatabaseExtendedAuditingPolicy_primaryWithOnlineSecondary\|TestAccMsSqlDatabase_createSecondaryMode -timeout 180m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccMsSqlDatabaseExtendedAuditingPolicy_primaryWithOnlineSecondary
=== PAUSE TestAccMsSqlDatabaseExtendedAuditingPolicy_primaryWithOnlineSecondary
=== RUN   TestAccMsSqlDatabase_createSecondaryMode
=== PAUSE TestAccMsSqlDatabase_createSecondaryMode
=== CONT  TestAccMsSqlDatabaseExtendedAuditingPolicy_primaryWithOnlineSecondary
--- PASS: TestAccMsSqlDatabaseExtendedAuditingPolicy_primaryWithOnlineSecondary (719.02s)
=== CONT  TestAccMsSqlDatabase_createSecondaryMode
--- PASS: TestAccMsSqlDatabase_createSecondaryMode (922.04s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql 923.660s

@aristosvo aristosvo added bug service/mssql Microsoft SQL Server labels Nov 15, 2021
@mbfrahry
Copy link
Member

Thanks for that but I'm seeing an issue with this test now TestAccMsSqlDatabase_createOnlineSecondaryMode

------- Stdout: -------
=== RUN   TestAccMsSqlDatabase_createOnlineSecondaryMode
=== PAUSE TestAccMsSqlDatabase_createOnlineSecondaryMode
=== CONT  TestAccMsSqlDatabase_createOnlineSecondaryMode
testcase.go:110: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
(map[string]string) (len=1) {
(string) (len=11) "create_mode": (string) (len=9) "Secondary"
}
(map[string]string) (len=1) {
(string) (len=11) "create_mode": (string) (len=15) "OnlineSecondary"
}
--- FAIL: TestAccMsSqlDatabase_createOnlineSecondaryMode (648.86s)
FAIL

@aristosvo
Copy link
Collaborator Author

aristosvo commented Nov 16, 2021

Sorry! I didn't commit all of it apparently😢

TF_ACC=1 go test -v ./internal/services/mssql -run=TestAccMsSqlDatabase_createSecondaryMode -timeout 180m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccMsSqlDatabase_createSecondaryMode
=== PAUSE TestAccMsSqlDatabase_createSecondaryMode
=== CONT  TestAccMsSqlDatabase_createSecondaryMode
--- PASS: TestAccMsSqlDatabase_createSecondaryMode (742.86s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql 744.490s

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this @aristosvo

@mbfrahry mbfrahry added this to the v2.86.0 milestone Nov 16, 2021
@mbfrahry mbfrahry merged commit cdd27b5 into hashicorp:main Nov 16, 2021
mbfrahry added a commit that referenced this pull request Nov 16, 2021
@github-actions
Copy link

This functionality has been released in v2.86.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug service/mssql Microsoft SQL Server size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot configure extended_auditing_policy in secondary create mode
2 participants