-
Notifications
You must be signed in to change notification settings - Fork 259
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
Cannot enable MSTest runner globally and disable it only on a subset of projects #2631
Comments
I get you maybe are filing this just for yourself, but what is the observed problem? |
We have had some requests from users who would like to enable the runner on all their test projects by default and selectively disable it on some projects. The idea being to set As shown in the repro zip file, this is not working. After some investigation, this is linked to how we register and define all the properties and targets (dependencies and order of resolution). I have done many variations and there is no good solution while maintaining an opt-in mechanism in MSTest. The only alternatives I have found are:
|
Conceptually, .props files imported before the project should not do any property calculation. I don't think going SDK will save you, since props are still going to be imported before |
The problem is that msbuild package target is imported before MSTest one so all processing will already be done. It was all conceived as alternative package and opt-in solution. For some simplicity we decided to squash it all under the adapter but that's causing an issue in the case of a global opt-in and specific opt-out. |
If you put the processing into your custom target that'd run before the build, you then sidestep all import order problems |
Yes that means we have to copy paste all the logic of the msbuild project and always make sure to keep it in sync. |
As far as I understand, you shouldn't even need the target, you just need to override two properties from msbuild project and it disables everything else from that .targets file. Check out my PR above |
Ok I see that there are Items the MSBuild package is defining, so although this will work, for static parsing that VS does this is probably not going to work. |
I have been looking at the problem from various angles and there is nothing we can do without breaking change so I will move the ticket as won't fix. |
Describe the bug
Cannot enable MSTest runner globally and disable it only on a subset of projects.
Steps To Reproduce
Use following repro
repro.zip
The text was updated successfully, but these errors were encountered: