fix: update required providers in resource.tf and add lifecycle ignore_changes for billing_policy_id in tests#1158
Open
fix: update required providers in resource.tf and add lifecycle ignore_changes for billing_policy_id in tests#1158
Conversation
…e_changes for billing_policy_id in tests
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Power Platform billing policy resource example and acceptance tests to make provider requirements clearer in examples and to reduce test flakiness from billing policy association drift.
Changes:
- Moved
terraform { required_providers { ... } }fromterraform.tfinto the billing policy example’sresource.tf, and removed the pinnedazurermversion. - Updated the billing policy environment acceptance test to use
lifecycle { ignore_changes = [billing_policy_id] }onpowerplatform_environmentresources instead of settingbilling_policy_iddirectly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/services/licensing/resource_billing_policy_environment_test.go | Makes acceptance test configs resilient to external/side-effect changes in billing_policy_id by ignoring drift on the environment resources. |
| examples/resources/powerplatform_billing_policy/terraform.tf | Removes the standalone terraform block file now that provider requirements are centralized elsewhere. |
| examples/resources/powerplatform_billing_policy/resource.tf | Adds required_providers into the main example configuration and removes the azurerm version pin. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1158 +/- ##
==========================================
- Coverage 73.71% 73.70% -0.02%
==========================================
Files 133 133
Lines 16522 16522
==========================================
- Hits 12179 12177 -2
- Misses 3208 3209 +1
- Partials 1135 1136 +1 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes updates to the Power Platform billing policy resource example and its associated acceptance tests. The main changes involve how required providers are defined and how the
billing_policy_idproperty is managed in test resources to improve test reliability.Provider configuration updates:
terraformblock specifying required providers fromterraform.tftoresource.tf, and removed the version constraint for theazurermprovider. This centralizes provider requirements and simplifies version management. [1] [2]Acceptance test improvements:
lifecycle { ignore_changes = [billing_policy_id] }block instead of directly setting thebilling_policy_idproperty. This change helps prevent unnecessary test failures due to external changes in the billing policy association. [1] [2] [3]