-
-
Notifications
You must be signed in to change notification settings - Fork 44
Honouring Test Explorer Filter to determine tests for FCC coverage runs #267
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
Comments
Use the new ms code coverage. |
Hi Tony, Apologies but I guess I'm missing a few steps in understanding your recommendation. Does ms code coverage let me define which tests are run to produce coverage? If so, can you point me to how this is controlled? I had a thought that it might be .runsettings related, but there doesn't seem to be formal support for defining a test filter in .runsettings - there are plenty of coverage filters, which I think just decide which assemblies, functions are reported, not which ones are used to run tests |
Done some more digging. With Run (Common):
When I run a test in Test Explorer, it runs fine. Test output window shows:
If I change Enabled to true and try and run the test again in Test Explorer:
It seems that FCC in mscodecoverage mode is affecting the ability to run the test in Test Explorer? |
Please can you share a solution that exhibits this behaviour |
It appears that this issue can arise with code coverage microsoft/vstest#1544 (comment) Perhaps this can help ? https://www.c-sharpcorner.com/article/how-to-resolve-issue-of-test-project-not-running-the-unit-tests-after-upgrade-to/ |
Closing as I do not believe that the exception is FCC related and that the test explorer filter is honoured when using ms code coverage. As for honouring the test explorer when not using ms code coverage. FCC uses reflection to obtain some Test Explorer information and from what I remember this information is not surfaced in the object structure that is available. |
Reopening as It should be possible for user to specify a logger in runsettings that will write the tests that were run and for that information to be used in the second ( coverage ) test run. I was also hoping that it was not necessary to have a second test run if the coverlet data collector is specified in runsettings but all I seem to get is
|
Issue with coverlet data collector mentioned in previous comment is documented in coverlet-coverage/coverlet#1332 (comment) So when that gets rectified or version 3.0.3 is used it will be possible to have a single run. |
@KeithWalters is Coverlet collecting coverage ? |
Installed product versions
Description
I've been trying to find a way to reduce the number of tests that are run by FCC for its coverage reporting.
From what I can tell, the inclusion/exclusion available in FCC settings applies to what Code is instrumented, rather than what tests are run.
It would be quite helpful if the filtering that, as a user, I have applied in Test Explorer could be used (optionally) as the set of tests that FCC runs.
Steps to recreate
Current behavior
All tests that are discovered across the whole solution are run by FCC in the background to establish coverage, including tests that were filtered out in Test Explorer.
Expected behavior
A setting/option to use the Test Explorer-configured filter to decide which tests to run for FCC purposes. When this setting is on, FCC runs coverage based only on that subset of tests.
Apologies in advance if this is a user education issue!
The text was updated successfully, but these errors were encountered: