Skip to content

[WIP] failOnMinTestsNotRun doesn't appear to work correctly #15096

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 12, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Description

Have an ADO pipeline using the JustMockVSTest@2 task, which sets a couple of env vars and then forwards the inputs and work to the VSTest@2 task.

I have a test dll that, while it does actually have tests in it, its build doesn't include the test adapter as part of its output, so VSTest is unable to enumerate the test cases to execute them.

I assumed the failOnMinTestsNotRun should catch this case, as there are no test cases run, but the build happily completes successfully!

Steps to reproduce

Explained in Description

Expected behavior

No tests run, task/build fails

Actual behavior

No tests run, task/build succeeds

Diagnostic logs

Attempt--1_p5u4gv.txt

Environment

This is a .Net 4.5 project on vmImage: 'windows-2019'.

Fixes #5017.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@nohwnd
Copy link
Member

nohwnd commented Jun 12, 2025

looks like your session timed out. Try again.

@nohwnd
Copy link
Member

nohwnd commented Jun 13, 2025

@copilot try one more time.

Copy link
Contributor Author

Copilot AI commented Jun 13, 2025

@copilot try one more time.

I've identified and fixed the issue in commit ef1de16. The problem was a potential null reference exception when TestRunStatistics is null (which happens when no tests are discovered). The TreatNoTestsAsError logic now correctly handles this scenario by safely defaulting to 0 executed tests when TestRunStatistics is null.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 7tjvsblobprodcus341.vsblob.vsassets.io
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)
  • c50vsblobprodcus330.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/vstest/vstest/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/vstest/vstest/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/vstest/vstest/artifacts/toolset/9.0.0-beta.25302.2.txt (dns block)
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)
  • c78vsblobprodcus322.vsblob.vsassets.io
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)
  • d0svsblobprodcus381.vsblob.vsassets.io
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • jd4vsblobprodcus366.vsblob.vsassets.io
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)
  • l49vsblobprodcus358.vsblob.vsassets.io
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)
  • uy6vsblobprodcus34.vsblob.vsassets.io
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)
  • vb4vsblobprodcus33.vsblob.vsassets.io
    • Triggering command: dotnet build test/vstest.console.UnitTests/vstest.console.UnitTests.csproj --no-restore -v minimal (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of nohwnd June 13, 2025 16:00
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.

failOnMinTestsNotRun doesn't appear to work correctly
2 participants