Skip to content

Leverage VerifyFile #9681

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Leverage VerifyFile #9681

wants to merge 3 commits into from

Conversation

SimonCropp
Copy link
Contributor

@SimonCropp SimonCropp commented Jun 4, 2025

Description

needs a squash on merge

https://github.com/VerifyTests/Verify/blob/main/docs/verify-file.md

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@Copilot Copilot AI review requested due to automatic review settings June 4, 2025 07:55
@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Jun 4, 2025
Copy link
Contributor

@Copilot 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 replaces content-based snapshot verifications (Verify(content, ext)) with file-based verifications (VerifyFile(path)) across multiple test suites.

  • Removed explicit file existence assertions and inline file reads
  • Updated all snapshot calls to use VerifyFile with the file path

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/Aspire.Hosting.Kubernetes.Tests/KubernetesPublisherTests.cs Switched to VerifyFile(deploymentPath)
tests/Aspire.Hosting.Docker.Tests/DockerComposeTests.cs Switched to VerifyFile(composeFile)
tests/Aspire.Hosting.Docker.Tests/DockerComposePublisherTests.cs Switched multiple calls to VerifyFile
tests/Aspire.Hosting.Azure.Tests/AzureEnvironmentResourceTests.cs Switched to VerifyFile(mainBicepPath)
Comments suppressed due to low confidence (4)

tests/Aspire.Hosting.Kubernetes.Tests/KubernetesPublisherTests.cs:100

  • [nitpick] Consider retaining a file existence check or ensure VerifyFile surfaces a clear error when the file is missing to improve test diagnostics.
Assert.True(File.Exists(deploymentPath));

tests/Aspire.Hosting.Docker.Tests/DockerComposeTests.cs:70

  • [nitpick] Consider keeping the precondition assert for file creation or verify that VerifyFile provides a descriptive failure when the file is absent.
Assert.True(File.Exists(composeFile), "Docker Compose file was not created.");

tests/Aspire.Hosting.Docker.Tests/DockerComposePublisherTests.cs:156

  • [nitpick] Without the explicit existence check, a missing file may yield an unclear error; ensure VerifyFile reports missing files clearly or restore the assert.
Assert.True(File.Exists(composePath));

tests/Aspire.Hosting.Azure.Tests/AzureEnvironmentResourceTests.cs:71

  • [nitpick] Recommend verifying file existence explicitly or confirming that VerifyFile handles non-existent paths with a meaningful message.
Assert.True(File.Exists(mainBicepPath));

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-integrations Issues pertaining to Aspire Integrations packages community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant