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

Cleaned up description decorator logic to allow loops #5160

Merged
merged 4 commits into from
Nov 30, 2021

Conversation

TSunny007
Copy link
Contributor

Fixed #5099

result.Template.Should().NotBeNull();
var templateContent = result.Template!.ToString();

templateContent.Should().Contain("rgNames param");
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be good to be more precise here, just in case something totally crazy happens in the future.

You should be able to write assertions like the following (for resources):

result.Template.Should().HaveValueAtPath("$.resources[?(@.name == 'rg30')].location", "[deployment().location]");
result.Template.Should().HaveValueAtPath("$.resources[?(@.name == 'rg31')].location", "[deployment().location]");

Or for variables:

result.Template.Should().HaveValueAtPath("$.resources[?(@.name == '[variables(\\'vnetName\\')]')].properties.parameters.subnets.value[0].name", "GatewaySubnet");
result.Template.Should().HaveValueAtPath("$.resources[?(@.name == '[variables(\\'vnetName\\')]')].properties.parameters.subnets.value[1].name", "appsn01");

Copy link
Member

@anthony-c-martin anthony-c-martin left a comment

Choose a reason for hiding this comment

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

Looks good!

@TSunny007 TSunny007 enabled auto-merge (squash) November 30, 2021 15:41
@TSunny007 TSunny007 merged commit a2da774 into main Nov 30, 2021
@TSunny007 TSunny007 deleted the tsunkaraneni/loopyDecorators branch November 30, 2021 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bicep compiler fails to account for output descriptions with loops
2 participants