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

Resolves issue 10346 - acctests failing on Recoveryservices #10347

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

MitchDrage
Copy link
Contributor

See issue 10346.
See errors gist
This resolves two issues in running acctests against RecoveryServices. Some other test failures are mentioned in the linked issue, however are caused by dangling resources from the below tests.

  1. --- FAIL: TestAccBackupProtectionPolicyVM_requiresImport
  • This test is failing due to a missing 'azurerm_backup_policy_vm' 'test' resource.
  • The test config in 'requiresImport' and the inherited config 'template' doesn't include a resource 'azurerm_backup_policy_vm' 'test', however basicDaily does.
  • Changing 'requiresImport' to reference 'basicDaily' instead of 'template' resolves the issue (basicDaily inherits from template anyway, and appears not to have any other purpose).
  • Result: --- PASS: TestAccRecoveryServicesVault_requiresImport (143.37s)
  1. --- FAIL: TestAccBackupProtectedVm_updateBackupPolicyId
  • Failure in test step 0 is due to a duplicate VM resource between the 'withVM' and 'base'. Removing 'withVM' and getting the VM config from 'withSecondPolicy' resolves the issue.
  • Failure in test step 1 also used the 'withVM' config. Moving this one to 'withSecondPolicy' also resolves this issue.
  • Step 2 is a step to revert the policy in step 1, so moving the config from 'withVM' to 'withSecondPolicy' removes the dependency on 'withVM' and resolves the 3rd issue.
  • The resource '"azurerm_backup_policy_vm" "test"' within 'withFirstPolicy' is also created in 'base' so throws a duplicate resource error. Removing 'withFirstPolicy' resolves the issue - it is redundant as best I can tell since all of it's resources are in 'base'.
  • By linking 'withSecondPolicy' directly to 'base', the following configs are now redundant and can be removed: withVM, withFirstPolicy, withVault. As touched on above, these three configs are all duplicating resources that are in 'base' and therefore throwing conflict errors.
  • 'withSecondPolicy' renamed to 'withBasePolicy' for cleanliness.
  1. Replaced 'address_prefix' with 'address_prefixes' as the former is deprecated.

@ghost ghost added the size/M label Jan 28, 2021
@katbyte katbyte added this to the v2.45.0 milestone Jan 28, 2021
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @MitchDrage - LGTM 👍

@katbyte katbyte merged commit 08b6d62 into hashicorp:master Jan 28, 2021
@ghost
Copy link

ghost commented Jan 28, 2021

This has been released in version 2.45.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.45.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Feb 27, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants