question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filtering default traits/categories in the .runsettings file

See original GitHub issue

VS Test Explorer displays all discovered tests by default. In dotnet/runtime some tests are disabled via traits (i.e. ActiveIssue, SkipOnTargetFramework, ConditionalFact, ConditionalTheory). These tests should be filtered out by default inside the VS Test Explorer by introducing a trait filter entry in the .runsettings file. Same applies to when running dotnet test on the CLI, default traits should be recognized in the .runsettings file.

  1. The .runsettings file needs a trait filter option, i.e. <TraitFilter>-failing,-IgnoreForCI</TraitFilter>
  2. That option needs to be honored by the VS Test Explorer UI.

cc @ManishJayaswal @singhsarab this is part of the the design document that I created a few months ago: https://github.com/ViktorHofer/designs-private/pull/1.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:25 (22 by maintainers)

github_iconTop GitHub Comments

3reactions
nohwndcommented, Mar 5, 2020

@vritant24 there is a PR, I marked you as a reviewer:

# file runsettings.settings
<RunSettings>
    <RunConfiguration>
        <TestCaseFilter>TestCategory=include</TestCaseFilter>
    </RunConfiguration>
</RunSettings>

Here is my project that I used to figure this out, it uses the nugets from the locally built vstest and testfx, let me know if you need any help plugging this into VS:

vstest.console --settings:runsettings.settings "C:\Projects\temp\UnitTestProject29\UnitTestProject29\bin\Debug\netcoreapp3.1\UnitTestProject29.dll"

UnitTestProject29.zip

1reaction
ViktorHofercommented, Mar 16, 2020

Thanks a lot for clarifying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure unit tests by using a .runsettings file
Autodetect the run settings file · Select Tools > Options > Test > Auto Detect runsettings Files. Auto detect runsettings file option in...
Read more >
Customizing Code Coverage Analysis - Visual Studio
By default, code coverage analyzes all solution assemblies that are loaded ... The run settings file is the configuration file used by unit ......
Read more >
How to select a tests form a test suite
I don't think TestCaseFilter is one of the properties allowed in the runsettings file. You would probably need to either filter your suite...
Read more >
Untitled
Path To VSTest.console.exe: C:\Program Files\Microsoft Visual ... Filtering default traits/categories in the .runsettings file #2273 - GitHub Visual Studio ...
Read more >
Runsettings file in Visual Studio 2019 not including ...
I am expecting runsetting file to include all files for code coverage and I should be able to exclude whatever files I don't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found