Unit test: parallel execution doesn't work - visual-studio-2010

I am useing unit test in visual studio 2010.
I change the Execution element in Local.testSettings file to
<Execution hostProcessPlatform="MSIL" parallelTestCount="4">
But all the tests running sequential.

Steps to solve the problem:
Step 1 - Open Local.testsettings => "data and diagnostics" tab, Disable all roles.
Step 2 - Reopen Visual studio

Related

Unit Tests show in Test Explorer but won't run in Visual Studio (2013 & 2015)

I have several ms unit test projects in my solution, when I go to Test Explorer all the unit test projects show up in the list:
When I hit "Run All" there is only one project that is discovered and run.
I can execute the other projects by selecting them individually and hitting "Run Selected Tests" but the Test Projects will not execute together automatically.
These tests use to run fine in the solution but have stopped within the last month or so running when "Run All" is used.
Thanks for any help!
I am using Visual Studio 2015 and faced the same problem few days back - when I clicked on 'Run All', all my Coded UI Tests ran but not my Unit/Integration Tests. Looking at your screenshot, it seems like you are facing the same problem where none of your 264 Unit Tests ran.
In my case -- Clearing my Temp files, resolved the problem for me.
Go to your START Menu and type %temp%
Once your Temp folder opens up, just delete all the contents.
Now go to your Visual Studio IDE, and from your Test Explorer window - click on 'Run All'
You should now see all the test projects(Coded UI, Unit Tests) being identified and executed.
Let me know if this does not solve your problem.

MSTest -> Why Can't I Debug Using BreakPoints?

I setup breakpoints, then run "Run Tests" in Visual Studio. Why don't MSTest run to my breakpoints?
Choose Debug -> Tests In Current Context (or otherwise)
For Visual Studio 2012 Express, I chose:
TEST -> Debug -> All Tests
When using MSTest via Start external program "mstest" specify the /noisolation option.
I had this problem after upgrading to MSTest V2. I referenced the new nuget packages, removed the existing MSTest reference, but no debugging. I read that I should no longer be using a test settings file, so I removed that; no joy. I finally discovered that clearing out my temp dir did the trick.
In my case it was that I had selected Release build. When I switched to Debug then my breakpoint was hit.
Visual Studio 2022
with msTest, options:
When you are in test method press Ctrl + r, Ctrl + t to debug the current test method.
Go to menu test > debug last run
Go to menu Test > debug all test
Go to menu Test > Test Explorer, when the window test explorer open, right clic over the test method you want > Debug
the problem is that you "run" the test, but you must "debug" the test so you can make use of break points.
cheers.
Reference about Testing in visual studio

Debugging code that's being tested in Visual Studio 2010

I am having some problems with a given test, that I'd like to debug the code that is being tested, while the test runs.
Is this possible?
If yes, how can I just debug this one test? I can only see options for running or the whole solution, or the whole set of tests in the current context or all impacted tests. I'd like to just run this one test, if possible!
I'm running Visual Studio 2010.
Put a breakpoint in the test and run the test with debug - use the test explorer to select just that test and "run selected".
See this MSDN page (How to: Run Automated Tests from Microsoft Visual Studio).

Does Visual Studio Test Essentials/Test Runner run web & load tests?

Looking at Amit Chatterjee's Blog post on the upcoming Visual Studio Test Essentials product and in the image he has (below) he basically he says that all the blue blocks will be in Test Essentials, while all the green will be in Visual Studio Test Edition.
(source: msdn.com)
I see Test Runner is on the blue block side - does that mean that I can create the web & load tests (green blocks) in Visual Studio Test Edition, and then using Test Runner in Test Essentials to actually run them?
The answer is yes - You will be able to create the test in Visual Studio Test Edition and use Test Runner to execute them.

How to debug mbunit/Gallio unit tests in visual studio

I am trying to figure out how I can hit breakpoints in my unit tests that are written with MbUnit/Gallio. I tried running Gallio.Icarus, attaching vs debugger to it, the breakpoints weren't hit.
Next I tried to start Gallio.Echo from project properties, but I was getting an error message, after supplying the dll, saying only .exe's can be tested.
The unit test runs fine from Gallio.Icarus, however, I am unable to debug them.
Thanks!
Grab Gallio v3.0.6 Update 1. Load up your tests and click on the shiny new "Debug" button in the Icarus GUI itself.
I would use TestDriven.Net for this. It supports MbUnit tests, and you can debug by simply right clicking from within Visual Studio
A much better answer is found here:
gallio test runner plugin to visual studio 2010
The answer is to add the following section to your *.csproj file the after the <ProjectGuid> section section:
<ProjectTypeGuids>
{3AC096D0-A1C2-E12C-1390-A8335801FDAB}
; {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
</ProjectTypeGuids>
See Also:
How Does Visual Studio Identiy test projects?
A list of supported VS2010 project types
Second list of GuIDs for supported project types

Resources