Skip to content

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
eerhardt:FollowupTest
Mar 28, 2025
Merged

Add test to ensure the scope is set correctly on an existing resource's role assignments bicep.#8353
davidfowl merged 1 commit intomicrosoft:mainfrom
eerhardt:FollowupTest

Conversation

@eerhardt
Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Mar 27, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 = """ ...

@davidfowl davidfowl merged commit 60918fb into microsoft:main Mar 28, 2025
167 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants