Skip to content

Centralize Verify convention - #9371

Merged
Sébastien Ros (sebastienros) merged 4 commits into
mainfrom
sebros/centralverify
May 17, 2025
Merged

Centralize Verify convention#9371
Sébastien Ros (sebastienros) merged 4 commits into
mainfrom
sebros/centralverify

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Found a way to centrally apply the HELIX contraints on Verify calls.

CopilotAI review requested due to automatic review settings May 16, 2025 23:54
@github-actionsgithub-actionsBot added the area-integrations Issues pertaining to Aspire Integrations packages label May 16, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request centralizes the verification logic by replacing explicit calls to Verifier.Verify(...).UseHelixAwareDirectory(...) with a unified Verify(...) call that implicitly handles HELIX constraints.

  • Updated test methods across various Azure test files to align with the new central Verify convention.
  • Removed redundant chaining of UseHelixAwareDirectory to avoid duplication of HELIX directory logic.

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
tests/Aspire.Hosting.Azure.Tests/AzureWebPubSubExtensionsTests.csRemoved explicit HELIX directory usage in Verify calls.
tests/Aspire.Hosting.Azure.Tests/AzureUserAssignedIdentityTests.csReplaced Verifier.Verify with centralized Verify for identity tests.
tests/Aspire.Hosting.Azure.Tests/AzureStorageExtensionsTests.csUpdated Verify call by eliminating UseHelixAwareDirectory.
tests/Aspire.Hosting.Azure.Tests/AzureSqlExtensionsTests.csUnified Verify method call across SQL test scenarios.
tests/Aspire.Hosting.Azure.Tests/AzureSignalRExtensionsTests.csRemoved HELIX-specific chaining from SignalR tests.
tests/Aspire.Hosting.Azure.Tests/AzureServiceBusExtensionsTests.csSimilar update with Verify call for ServiceBus tests.
tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.csTransitioned to centralized Verify without HELIX directory usage.
tests/Aspire.Hosting.Azure.Tests/AzureResourceOptionsTests.csUpdated Verify call, removing explicit HELIX directory chaining.
tests/Aspire.Hosting.Azure.Tests/AzureRedisExtensionsTests.csConsolidated Verify call to central Verify.
tests/Aspire.Hosting.Azure.Tests/AzureProvisioningResourceExtensionsTests.csStandardized Verify call by removing UseHelixAwareDirectory.
tests/Aspire.Hosting.Azure.Tests/AzurePostgresExtensionsTests.csAdjusted Verify usage to the new centralized convention.
tests/Aspire.Hosting.Azure.Tests/AzureKeyVaultTests.csRemoved HELIX directory chaining in favor of central Verify logic.
tests/Aspire.Hosting.Azure.Tests/AzureFunctionsTests.csUpdated Verify calls in functions tests with the central method.
tests/Aspire.Hosting.Azure.Tests/AzureEventHubsExtensionsTests.csRemoved explicit HELIX directory usage in Verify chain.
tests/Aspire.Hosting.Azure.Tests/AzureEnvironmentResourceTests.csTransitioned to centralized Verify without HELIX configuration.
tests/Aspire.Hosting.Azure.Tests/AzureCosmosDBExtensionsTests.csUnified Verify usage by removing HELIX chaining.
tests/Aspire.Hosting.Azure.Tests/AzureContainerRegistryTests.csUpdated Verify call to align with the new convention.
tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.csReplaced multiple instances of UseHelixAwareDirectory with Verify.
tests/Aspire.Hosting.Azure.Tests/AzureBicepResourceTests.csReplaced explicit HELIX directory calls with central Verify.
tests/Aspire.Hosting.Azure.Tests/AzureAppServiceTests.csUpdated Verify calls to remove direct HELIX directory specification.
Comments suppressed due to low confidence (1)

tests/Aspire.Hosting.Azure.Tests/AzureWebPubSubExtensionsTests.cs:61

  • Ensure that the new Verify method centrally applies the HELIX directory logic previously provided by UseHelixAwareDirectory, so that snapshot output remains in the intended location.
await Verifier.Verify(manifest.BicepText, extension: "bicep")


await Verifier.Verify(bicep, extension: "bicep")
.UseHelixAwareDirectory();
await Verify(bicep, extension: "bicep");

CopilotAIMay 16, 2025

Copy link

Choose a reason for hiding this comment

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

Consider adding a documentation comment in the Verify method definition to clarify that it now implicitly handles the HELIX constraints, removing the need for an explicit UseHelixAwareDirectory call.

Copilot uses AI. Check for mistakes.
@davidfowl

Copy link
Copy Markdown
Collaborator

Nice! Merge these so we have one module initializer

https://github.com/dotnet/aspire/blob/main/tests/Shared/TestModuleInitializer.cs

@sebastienros
Sébastien Ros (sebastienros) deleted the sebros/centralverify branch May 17, 2025 20:07
@davidfowl

Copy link
Copy Markdown
Collaborator

Watch the main build

@sebastienros

Copy link
Copy Markdown
ContributorAuthor

/// <summary>
/// Sets the directory for the Verify call in a way it's also compatible with Helix.
/// </summary>
public static SettingsTask UseHelixAwareDirectory(this SettingsTask settings, string directory = "Snapshots")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this still used somewhere?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It's not.

Didn't want to remove it yet to keep the knowledge of how it's done.

@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jun 19, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrationsIssues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebastienros@davidfowl@RussKie