-
Notifications
You must be signed in to change notification settings - Fork 323
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
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. |
src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs
Outdated
Show resolved
Hide resolved
src/vstest.console/Processors/RunSpecificTestsArgumentProcessor.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Description
Introduce new
RunConfiguration
parameter calledTreatNoTestsAsError
, which can have valuestrue
andfalse
.true
means 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.runsettings
file, if the latter exists.This works the same for
dotnet test
command.Fix #2590
Fix #2262
Fix #2247
Update: renamed FailWhenNoTestsFound to TreatNoTestsAsError as it was shipped.