Skip to content
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

Single tests should be able to be run through the IDE #14412

Closed
mmitche opened this issue Apr 2, 2015 · 9 comments
Closed

Single tests should be able to be run through the IDE #14412

mmitche opened this issue Apr 2, 2015 · 9 comments

Comments

@mmitche
Copy link
Member

mmitche commented Apr 2, 2015

Currently there seems to be some miscommunication between the corefx repo/project setup and the IDE, and the test discovery inside the IDE for xunit is broken.

This makes it difficult to run single tests

@Clockwork-Muse
Copy link
Contributor

Or debug single tests.

@weshaggard
Copy link
Member

We currently do not have support for hosting and running xunit within VS. That actually requires a fair amount of work but we can use this issue to track that work.

This is called out in our wiki https://github.com/dotnet/corefx/wiki/Developer-Guide

Running tests from using the VS test explorer does not currently work after we switched to running on CoreCLR. We will be working on enabling full VS test integration but we don't have an ETA yet. In the meantime, use the steps above to launch/debug the tests using the console runner.

@terrajobst
Copy link
Contributor

Thanks @weshaggard. I've added the link to the paragraph in the wiki you quoted.

@MattWhilden
Copy link
Contributor

Work around courtesy @mmitche in gitter:
I am guessing it has something to do with the build tools
we have a set of shared msbuild build tools for various projects
(along with a custom xunit runner that can run on Linux, since the stock one uses features that coreclr doesn't have)
I think the build tools targets and such are interfering
here's a bit of a workaround suggestion
you could add a new category (say..MyTest) temporarily
then change the project to have the TestCategories property only say MyTest
that should only run your test category
that might be a decent temporary solution
i'm going to file an issue in CoreFX against this

@eatdrinksleepcode
Copy link

@MattWhilden @mmitche Is that a workaround for running a single test from the command line? If so, there is a much simpler way:

You can pass xunit parameters to the build by setting the XunitOptions property:

msbuild /t:Test "/p:XunitOptions=-class Test.ComponentModelTests"

@mmitche
Copy link
Member Author

mmitche commented Apr 8, 2015

I think you can even get more specific with the version of xunit we have:

-method [MethodName]

@eatdrinksleepcode
Copy link

Yes, sorry, I was just quoting my previously posted example.

Specific examples should be added to the wiki, but I don't have access to do that, and GitHub doesn't allow PRs for wiki pages.

@Clockwork-Muse
Copy link
Contributor

Well, I know how to run single tests from the command line, which was less complicated than whatever this workaround is supposed to be (I'm not entirely clear on what the intended process is supposed to be - thanks to @eatdrinksleepcode for finding the current command I use).  Of course, since the build tools are out of date (fixed, but corefx hasn't picked it up yet), it doesn't use what the IDE built...What I'd really prefer is a way to debug from the IDE.  The current directions spawn all tests, and again, not whatever the IDE built.  @mmitche gave me a command to try, but my debugger install is apparently borked, so can't test it.
Side note - I thought corefx was supposed to be the fast track; should we be grabbing latest whatever during full builds?

@mellinoe
Copy link
Contributor

mellinoe commented Nov 7, 2016

You can run single tests in VS by modifying the command line passed in the Debug tab of project properties. Enabling the test explorer window is a large piece of work that should be tackled as its own effort.

@mellinoe mellinoe closed this as completed Nov 7, 2016
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants