Implemented functionality to return non-zero value when no tests available.#2610
Implemented functionality to return non-zero value when no tests available.#2610
Conversation
…ng to create TestResults folder
…r path in that message
|
Will the related issues be fixed by this? Is there a reason to not mark them as Fix in the description? Is there a reason the name from the proposal "TreatNoTestsAsError" is not used? Or is it simply personal preference? |
|
All mentioned issues are the same, only one of them related to |
|
Updated the description to automatically close the linked issues, when you merge. It's easier to navigate back to the change that way, and it avoids keeping up with related issues manually. |
Haplois
left a comment
There was a problem hiding this comment.
Mostly nitpick, but I think we should use "Discovered" instead of found, and use singular "Test" instead of "Tests".
|
I changed the name to |
|
For the benefit of people (like me) who need this feature but don't find it well documented, the magic you need to add to the command line is Note the space after the |
|
The documentation here (https://learn.microsoft.com/en-us/visualstudio/test/vstest-console-options?view=vs-2019) incorrectly lists |
|
That option was not shipped, updated the docs. MicrosoftDocs/visualstudio-docs#9266 |
|
In a mature project this functionality is sound. |
Description
Introduce new
RunConfigurationparameter calledTreatNoTestsAsError, which can have valuestrueandfalse.truemeans that we want to return non-zero value when no tests are available.Parameter can be set through runsettings file
<RunConfiguration><TreatNoTestsAsError>true</TreatNoTestsAsError> </RunConfiguration>as well as through command line :-- RunConfiguration.TreatNoTestsAsError=true. Command line argument has higher priority, so it will override the value in.runsettingsfile, if the latter exists.This works the same for
dotnet testcommand.Fix #2590
Fix #2262
Fix #2247
Update: renamed FailWhenNoTestsFound to TreatNoTestsAsError as it was shipped.