Skip to content

Re-enable PerTestFrameworkTemplatesTests#14451

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-nunit-pertestframeworktests
Draft

Re-enable PerTestFrameworkTemplatesTests#14451
Copilot wants to merge 2 commits intomainfrom
copilot/fix-nunit-pertestframeworktests

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Description

Template tests were disabled due to VSTHRD200 analyzer errors on template-generated test methods lacking "Async" suffix. The root cause—unintended analyzer propagation into template builds—has been resolved. Re-enabling tests by removing ActiveIssue attribute.

Template test methods like GetWebResourceRootReturnsOkStatusCode() correctly omit "Async" suffix per test naming conventions. The analyzer should not have been applied to these generated projects.

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No
Original prompt

This section details on the original issue you should resolve

<issue_title>Failing test Nunit_PerTestFrameworkTemplatesTests.TemplatesForIndividualTestFrameworks</issue_title>
<issue_description>Failing build with:

WebTests.cs(10,23): error VSTHRD200: Use "Async" suffix in names of methods that return an awaitable type (https://github.com/Microsoft/vs-threading/blob/main/doc/analyzers/VSTHRD200.md)

This broke in #7869 and slipped through because we don't run template tests for PR validation.
cc @DamianEdwards @joperezr @eerhardt

EDIT:
Also,
Aspire.Workload.Tests.BuildAndRunTemplateTests.BuildAndRunStarterTemplateBuiltInTest: \WebTests.cs(10,23): error VSTHRD200: Use "Async" suffix in names of methods that return an awaitable type (https://github.com/Microsoft/vs-threading/blob/main/doc/analyzers/VSTHRD200.md)

.. and Aspire.Workload.Tests.Nunit_PerTestFrameworkTemplatesTests.TemplatesForIndividualTestFrameworks: IntegrationTest1.cs(19,24): error VSTHRD200: Use "Async" suffix in names of methods that return an awaitable type (https://github.com/Microsoft/vs-threading/blob/main/doc/analyzers/VSTHRD200.md</issue_description>

<agent_instructions>Adding the Async suffix would be incorrect way to do this. The original issue was that some unintended analyzers were getting pulled into the build.

Instead, try to remove the ActiveIssue attribute on the test, and check if the test passes. If it does then analyzer issue is no longer there, and we can re-enable the test.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@danmoseley You scratched that out? Apparently we build templates in official build, maybe that's enough.

I"ll fix since I'm there.</comment_new>
<comment_new>@radical

You scratched that out?

Yeah, I was trying to check why it is being hit now because the particular lines in the error didn't change in that commit. But also it started failing after that one. Did we update the sdk being used, or have new analyzers?</comment_new>
<comment_new>@radical

Apparently we build templates in official build, maybe that's enough.

It wouldn't have been caught there because only the Workload(template) tests create projects from the templates.</comment_new>
<comment_new>@radical
@danmoseley since you are fixing this, fyi, I have updated the description with two more cases of the same thing but in other templates.</comment_new>
<comment_new>@danmoseley
#8012

I just searched for async Task .*(?<!Async)\( .. I don't know why but VS doesn't give this error when I opened a project created from the templates</comment_new>
<comment_new>@eerhardt
This failed from #7991. I reverted that change with #7999. You can read why it broke in the revert PR description.</comment_new>
<comment_new>@radical

This failed from #7991. I reverted that change with #7999. You can read why it broke in the revert PR description.

Ah.. should we close this, and the corresponding PR then?</comment_new>
<comment_new>@eerhardt

Ah.. should we close this, and the corresponding PR then?

Yes, I believe so.</comment_new>
<comment_new>@mitchdenny
Tjese tests</comment_new>
<comment_new>@mitchdenny
These tests are failing in the outer loop build again:

Image

I've put up a PR to disable them:

#12443</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing test Nunit_PerTestFrameworkTemplatesTests Re-enable PerTestFrameworkTemplatesTests Feb 11, 2026
Copilot AI requested a review from radical February 11, 2026 21:05
@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14451

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14451"

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.

Failing test Nunit_PerTestFrameworkTemplatesTests.TemplatesForIndividualTestFrameworks

2 participants