Running MSTest and xUnit during the same test session

I have a mix of unit tests.  Some are written using MsTest and others using xUnit.  I can run them both in the test runner but not at the same time.  If I click on "Run All Tests" then only my MsTest tests are run.  The xUnit tests don't run.  I have to click on the test class for my xUnit tests and click the 'Run Unit Tests" button.

Is there a way for the test runner to run all tests regardless of their test framework?

I am running ReSharper 7.1.3 on VS 2012 on Win8 x64 Pro.

Thanks,
Paul

7 comments
Comment actions Permalink

Hi Paul. What's your setup? Are the tests in the same assembly, or different assemblies? How are you running the tests - the run all on the unit test session window, or the right click menu?

I've just tried running a simple example with two test classes in the same file (so same assembly), and it works. But, when I first run all, it runs the xunit tests, then marks the mstest tests as inconclusive - but if I wait a minute, it runs the test, and marks them as pass or fail.

Thanks
Matt

0
Comment actions Permalink

Hi Matt,

The tests are in the same assembly.  The xUnit tests are in their own class.  I am running all the tests in my two test projects at once using the Unit Test Explorer window.  I'm right clicking on the Tests solution folder and selecting Run Selected Tests.  This runs all the MsTest tests but leaves the xUnit tests are "Inconclusive: Test wasn't run".

I've let it sit for 5 minutes but it still doesn't run the xUnit tests.  I can manually click on the xUnit tests and select Run and then it will run those xUnit tests.

I just tried to use the "Run All" toolbar button in the Unit Test Sessions window but with the sam results.  MsTest tests run but the xUnit tests say "Inconclusive: Test wasn't run".

If it makes any difference, aside from the mixed unit test assembly with the MsTest and xUnit tests, I have another unit test assembly that contains only MsTest tests.  The test runner runs all the MsTests from both assemblies.  Other than that my setup sounds very similar to yours.

Thanks for your help,
Paul

0
Comment actions Permalink

Hmm. A couple of things:

1. Are you using the latest version of the xunit plugin? It should be version 1.0 - https://xunitcontrib.codeplex.com/releases/view/104516
2. In the ReSharper Options -> Unit Testing, have you changed the "Run up to X assemblies in parallel"? Mine says 4, I wonder if that has any impact (I think it needs to run the assembly twice - once for xunit and once for mstest)
3. What happens if you right click on the project and select Run All Tests? The same?

0
Comment actions Permalink

Hi Matt,

I believe I am running version 1.9.1.1600 of the xUnit plugin.

I have Resharper set to run 10 assemblies in parallel.

Same behavior if I right click the project and select Run Tests, the xUnit tests are marked as inconclusive, test wasn't run.

Thanks,
Paul

0
Comment actions Permalink
That's the version of the xunit.dll - can you go to ReSharper -> Options -> Plugins and see what the version of the xunitcontrib plugin is, please?
0
Comment actions Permalink

Hi Matt,

The xunitcontrib plugin is version 1.0.0.27432.

Thanks,
Paul

0
Comment actions Permalink

Hi Paul. Looks like you're all up to date, but we can't figure out why you're seeing this - we can't reproduce the error. Are you doing anything interesting with .net versions? Do you have a small project you can use to reproduce it?

Alternatively, could you try the ReSharper 8.0 EAP? It's had a change made where tests from different providers are run in separate processes, which might help this situation. The xunit runner is available from the new extension manager - http://blogs.jetbrains.com/dotnet/2013/04/new-features-in-the-latest-resharper-8-ea/

Thanks
Matt

0

Please sign in to leave a comment.