How Resharper test runner run much faster than the Visual Studio one - visual-studio-2017

I have a test suite that contains 700 tests. When I run them using Resharper, the total time is about 5 minutes. When I run them using Visual Studio 2017 it takes more than 45 minutes. What are the possible differences between these two tools that could affect the performance that much?
Extra infos:
I'm using a lib to make my tests use a DB in-memory instead of a SQL one. To do so, I create a a transient connection before each test. It might seems a lot, but still, Resharper handle all tests in 5 minutes.
I use Effort for my in-memory connection.
Also, the tests running on Visual Studio seem to get slower and slower the more tests it executes. Is it possible VS doesn't dispose the connection the same way Resharper does?
I obtained the same results with Nunit and MStest
Thanks!

Related

How to disable test discovery in visual studio 2017?

I have some solutions with a bunch of projects and we have no unit test project in these solutions. However Visual Studio 2017 is still trying to discover unit tests and slowing down our process.
https://imgur.com/a/89Vt1P6
I looked at the runsettings xml file but there was nothing in there to disable it
https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file
any idea how we turn this unnecessary stuff off for some of our solutions?
Thanks
This was driving me crazy too. One day it just started running test discovery after every build, and switching my output pane to "Test" which is annoying.
How I fixed it in VS 2015 (may be the same for 2017),
disable (uncheck) this setting:
Test menu --> Test Settings --> Keep Test Execution Engine Running

visual studio code unit test discovery frequency setting

When I'm updating my existing unit tests, Visual Studio code drops a status bar from the top letting me know that it could not correctly discover unit tests every time I save the file. This is expected since I'm actively typing so everything is not working python.
Have I configured something incorrectly? Is there some way to tell visual studio to chill out on the unit test discovery?
Of course, I can simply hit the "close" button, but this is extremely distracting.
Disable Live Unit Test running on the background.
Under Test->Test Settings-> uncheck 'Keep Test Execution Engine Running'. I am using VS 2017 & VS 2015.

ReSharper unit tests pending indefinetely

first of all, I've never used unit tests with ReSharper before, so I don't know how to debug it. The problem is that if run MS unit tests by VS test explorer everything works fine, but if I run it through resharper's Unit Test Sessions it just does nothing and stays in a pending state, even with just one test starting with Assert.Fail. I am seeing no load on CPU or anything.
I am using ReSharper 8.0.14.856 with Visual Studio 11.0.50727.1 . Searches bring me many results with older versions, but I guess those should work fine?
As I see you use VS2012 RTM, but according to http://www.jetbrains.com/resharper/download/index.html -> "System requirements", you need to have at least Visual Studio 2012 Update 3 (there were some changes in MSTest API between RTM and Update 3, ReSharper 8 supports the latest ones). So, please install Update 3 to your VS2012 installation and you will be able to run MSTest tests.

How can I set up unit tests to run for different environments?

I'm considering running unit tests for my Visual Studio 2010 projects on our build server at build time. The problem is that when I'm working locally, I want to test against DEV, when building for QA, I want the tests to run against QA, when building/promoting for UAT/PROD... you get the picture.
I think VS 2010 might have support for per-environment configs. If so, does this apply for test projects also? If not, what are some alternatives?
thanks,
Mark
I don't really have much experience with VS 2010, but there was no such functionality in VS 2008.
I usually have a msbuild script to build and run the tests of the solution. In your case I would have a step in the this script to set the correct configuration after the code was built and before the tests are run. I used XmlUpdate task from http://msbuildtasks.tigris.org/ last time.

How to avoid breaking build when committing Visual Studio Unit Tests in CruiseControl.Net

I'm having a problem when a project is committed to SVN, which in turn is automatically picked up by our newly set-up CruiseControl.NET server, the UnitTests are failing.
The unit tests are written in the default Visual Studio Unit test framework - which is the problem. I spot that nUnit appears to be recommended as a good alternative. However, that doesn't change my current predicament - I would like a working build without having to re-write every single one of my Unit Tests in the nUnit Framework (Would converting a MS Unit Test project take any considerable amount of time - it looks the same to me?)
What is the best way for me to proceed now? We are unable to install Visual Studio on the box and our IT department won't allow us access to go fiddling in the registry.
I am not sure how to run unit tests without Visual Studio, but I had moved to NUnit from MSTests and its reasonably easy - as long as you don't use the test context from MSTest(can't remember the real name), all you have to do is to rename the tags [TestClass] -> [TestFixture], etc (there is always 1-1 mapping) and change the usings. Running NUnit tests on the build machine is trivial.
Also you can try to convince your company to buy you a copy of Resharper (preferred), or TestDriven.NET - so you can easily run NUnit tests from Visual Studio.