visual studio code unit test discovery frequency setting - unit-testing

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.

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 2013 running unit test

I'm using Visual Studio 2013, and I have a legacy solution that I need to modify, containing a a console application and a unit test project.
I want to run the console application project, and while it's running I also want to run one of my unit tests.
I run my console application, but when I go to the test explorer to run my unit test, the option is grayed out.
why is this, and how can I run my unit test?
You don't mention why you want to do this, so I'll just answer blind.
If you run your console app without debugging, then you can run your unit tests at the same time.
To run without debugging, use Ctrl+F5 (DEBUG -> Start Without Debugging).
Alternatively, open your console app's project folder, go to the bin\Debug folder and double-click on <your_app>.exe.
FWIW it doesn't sound like a very good idea to do this. Unit tests are meant to be runnable completely separately from your application.

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 to profile unit tests in Visual Studio 2012?

Is it possible to profile MSTest unit tests in Visual Studio 2012 Ultimate without using any external profiling tools?
This feature was added back in the upcoming Visual Studio 2012 Quarterly Update 1. Right-click the test you want to profile in the Test Explorer and select "Profile Test" from the context menu.
In Visual Studio it was a really powerful feature !
As you, I can not find it in VS2012 (no references in MSDN or in blogs, ...)
Now, the only solution I have found for profiling Unit Test is to Attach the Profiler to a Process called vstest.executionengine.x86.exe (x86 for me but this could be different for 64 bits)
You can do this in the Tab "Performance Explorer" after a right click.
Once the profiler is starting, you can run as many tests as you want. Then stop profiling and you will see all details of this session.
There are 2 caveats with this technique :
for some reasons, the process is missing in the list. Maybe it stops when idle. Start just one test te see it.
You have to Attach the Profiler for every sessions. I don't find yet a way to script it.
Hope this will help you.
In Visual Studio 2015, follow the instructions Cybermaxs gives, but select TE.ProcessHost.Managed. Unfortunately, there appear to be two of them, so you must select the one with higher CPU usage.
With VS 2019/2022 you attach to the testhost process while running your tests. Just run your tests in debug, and stop execution on breakpoint, then you can find that process to attach.

Weird problem with Visual Studio - when I change the name of a unit test, it does not update

I've run into a weird problem with Unit Tests in Visual Studio 2010 that I can't solve (is this a bug in Visual Studio?).
If I edit the name of a unit test, it is not updating in the "Test List Editor" view. If I add a unit test using the normal method, it doesn't add it to the list of unit tests.
Any ideas on what might be possibly be causing this, and perhaps brainstorming some method to redo my Unit Test project to fix this problem?
Found the problem: I have ReSharper installed, and it unexpectedly took over the default unit testing framework provided by Visual Studio 2010, when an auto version upgrade took place. I am currently running the unit tests using the ReSharper unit testing plugin, and everything works fine. This is not to say that it's necessarily ReSharper's fault, I did opt in to use the enhanced unit testing framework when I installed it a month ago (and I can opt out by switching it off in options).