-
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
Make Run target and VS F5 work for test projects #2425
Comments
What is in the runsettings that is specifically allowing this to work? We recently added the ability to add settings on project level for dotnet test #2272 remember? 🙂 The actual execution is not as simple, to run a test you need vstest.console and testhost. Test host is quite easy to bundle with the project to make it self-host, but adding vstest console is a bit more difficult, and seems unnecessary. |
Nothing, you can ignore the runsettings argument for the sake of this issue.
Right, in this case I was talking about invoking a test assembly from dotnet test which currently doesn't auto discover a .runsettings file in the same directory: #2418.
Run and VS F5 use the My ask is that the Microsoft.Net.Test.Sdk nuget package overwrites these properties (and I'm willing to submit a PR to make that work 😀):
This will make F5 and /t:Run work with test apps but to successfully debug the application (meaning the module is loaded and breakpoints hit), these additional steps need to be done: https://github.com/dotnet/runtime/blob/master/docs/workflow/testing/visualstudio.md#visual-studio-f5-debugging-support. I suggest to document them officially as I only stumbled upon that info via Twitter :D |
Submitted a PR to better to better illustrate the proposal: #2428. |
Would this interfere with test frameworks that treat the test project as a runnable console app already? Those are naturally F5-debuggable. |
Which ones of the supported test frameworks are runnable by default? |
Fixie (full disclosure, this is my pet project). Letting the test project be truly a runnable console app solved a lot of the problems introduced when .NET Core arrived and AppDomains disappeared. More to the point for the larger community, I've seen past tweets from the xUnit team that they were at least considering this model for xUnit v3 which is actively under development. |
This won't be done for the current test platform, overriding more user settings is something we don't want to do now. |
In dotnet/runtime we are currently setting the following properties to make F5 work:
https://github.com/dotnet/runtime/blob/21e8298bfdeb833bdcd000ff2cf90a765c05a02a/eng/testing/xunit/xunit.targets#L7-L15
I feel like this shouldn't be needed to be set by individual consumers and should come via the Microsoft.Net.Test.Sdk package. Ideally the
--settings
switch wouldn't be required to be set: #2418.cc @tmat @nohwnd @ManishJayaswal
The text was updated successfully, but these errors were encountered: