I currently manually add -trait="Integration" to the Test Explorer search to make sure I don't run any tests marked as Integration.
How can I make this the default?
I currently manually add -trait="Integration" to the Test Explorer search to make sure I don't run any tests marked as Integration.
How can I make this the default?
There doesn't seem to be a way to default this search, but I think a good solution to your problem is to make use of a playlist and add all of the tests with the "Integration" trait to the playlist.
You can even pin this playlist window like any other window. The only downside to this is you have to continue to add new tests to it as you go. However that should be fairly easy to do via these steps.
You could define the filter in a vstest.runsettings file:
<RunSettings>
<RunConfiguration>
<TestCaseFilter>TestCategory!=Integration</TestCaseFilter>
</RunConfiguration>
</RunSettings>
The TestCaseFilter element uses the same syntax as the command line expression used in dotnet test --filter (https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests?pivots=mstest).