Add test to ensure the scope is set correctly on an existing resource's role assignments bicep.#8353
Merged
davidfowl merged 1 commit intomicrosoft:mainfrom Mar 28, 2025
Merged
Conversation
…'s role assignments bicep. Follow up from microsoft#8280
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a test to ensure that the correct scope is set on an existing resource's role assignments in the Bicep output.
- The test now builds a service provider and retrieves the DistributedApplicationModel from DI.
- It adds extra assertions for verifying the manifest and Bicep output for the messaging roles resource.
Comments suppressed due to low confidence (2)
tests/Aspire.Hosting.Azure.Tests/ExistingAzureResourceTests.cs:219
- [nitpick] Consider renaming 'messagingRoles' to a more descriptive name like 'messagingRolesResource' to better reflect its purpose.
var messagingRoles = Assert.Single(model.Resources.OfType<AzureProvisioningResource>().Where(r => r.Name == $"messaging-roles"));
tests/Aspire.Hosting.Azure.Tests/ExistingAzureResourceTests.cs:238
- [nitpick] Comparing multi-line string literals can be brittle due to minor whitespace variations; consider normalizing whitespace or using a more flexible comparison method.
expectedBicep = """ ...
5 tasks
joperezr
approved these changes
Mar 27, 2025
captainsafia
approved these changes
Mar 27, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.