Can't run unit test Visual Studio 2012 Ultimate - unit-testing

When I try to run a specific test on Visual Studio 2012 Ultimate, I have an error message : "Process with an Id of -1 is not running" (not sure of the translation, sorry).
And when I try to execute all the tests, the error message is "The specified file can't be found".
All my tests are detected, but none are executed. I've spent two days trying to make these tests work: recreating the test project, running the tested project under IISExpress instead of IIS, renaming the IISExpress folder in My Documents, forcing the compilation for x86 or x64, removing fakes assemblies, cleaning solution... nothing worked.
I use the built-in MSTest framework, and no specific framework is installed.
Here is the message I get in debug:
And here is what I get when I "only" execute:
English error messages:
------ Run test started ------
Process with an Id of -1 is not running.
========== Run test finished: 0 run (0:00:00,1050004) ==========
------ Run test started ------
The system cannot find the file specified
========== Run test finished: 0 run (0:05:16,7847051) ==========

After debugging Visual Studio itself it turns out that Visual Studio is trying to launch vstest.executionengine.x86.exe.
Which doesn't exist in your instance of 2012:
Solution
I repaired Visual Studio 2012 from the Programs and Features panel of Windows and that fixed the tests.
Upgrading it to Visual Studio 2012.4 seems to keep the tests in a running state. If you choose to repair 2012, make sure you also re-apply the latest update pack (Update 4), if you had an update installed.
Opening the project in Visual Studio 2013.4 or 2015 Preview also seems to work. So it seems that something has broken Visual Studio 2012 Ultimate somehow and repairing it resolves the issue.

Related

Error while executing the coded UI automated test cases using MTM 17

Test Logs:
"Queued the TMI run for test run [1594]." TestOutcome 'Warning';
Message 'Warning: Test Run deployment issue: The assembly or module
'Microsoft.VisualStudio.Shell.15.0' directly or indirectly referenced
by deployment item 'C:\Program Files (x86)\Microsoft Visual Studio'
specified by the test settings was not found.'."
Several other similar errors.
Not sure why is it showing so.
It sounds like you need to install the appropriate version of the Agents for Visual Studio package on the machine where you're trying to run these tests.
The 2017 version should be what you're after if you're using Visual Studio 2017.

VS 2015: TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid ''

I Have VS 2015 only installed on my TFS 2013 build server, and get the following error:
TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid ''.
Other sites say to install VS 2013, but why would I have to install VS 2013 on the build server to run unit tests when I have VS 2015 installed?
I have the following switches on my build:
/p:VisualStudioVersion=14.0 /tv:14.0
(This is not a duplicate question as I am using TFS 2013 and am trying to use the Agile Test Runner not MS Test)
Check the solution in this case:
Install VS 2015 or Microsoft Build Tools 2015.
Edit build to use a build process template called TfvcTemplate.12.xaml.
Set MSBuild arguments to /tv:14.0.
But this setting only works for build, not test. As there is no way to set the tool version or tool path for "Run VS Test Runner" activity, installing VS 2013 should be the only way to get rid of this error.
I had a similar problem - was getting the error
TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid 'D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow'.
It ended up being that even though Visual Studio 2015 was installed on the build agent, the user that the Build Agent was running as didn't have read/execute permissions to that folder.

TFS 2012: F900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid

We have a TFS 2012 Server and Visual Studio 2015 on the Client side.
The Problem is that when I am building a project containing tests i get the following error on the TFS: F900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid.
On this post i got the information that i have to choose MSTest as the test runner in the build definitions.
But when i try this i get no options to choose for the test runner.
It is greyed out like described in this post. The solution mentioned here is that I had to install a version of Visual Studio 2013 on my build server to get it working.
I already have an installation of Visual Studio 2015 Professional installed on the server but it is still showing the error and i still have no more options to choose from as test runner than Visual Studio Test runner
Why do i not have MSTest as an option as the test runner and how can i fix this?
AND/OR
How can i fix the problem of having this error without installing Visual Studio 2013 on the Build Server?

Getting F# tests to be detected by Visual Studio 2013 Express for Desktop

I've defined the following F# file:
module MyFsTest
open NUnit.Framework
open FsUnit
[<Test>]
let ``1 + 1 = 2``() = Assert.AreEqual(2, 1+1)
yet when I try to run them either through "Test Explorer" or "Right Click + Run Tests" a build is done yet no tests are detected/run:
------ Discover test started ------
========== Discover test finished: 0 found (0:00:00,0320018) ==========
After googling a bit I've found my approach seems to resemble the steps taken # http://davesquared.net/2013/03/hello-world-testing-in-fsharp.html, so I was wondering if there's something else I might be missing?
To use NUnit tests with the built-in Visual Studio test runner, you'd need to install the NUnit test adapter. This is available for Visual Studio 2013, but I believe it is not possible to install it as an extension to the Express edition.
However, the Express edition includes support for the Microsoft Visual Studio testing framework, which is supported by the built-in test runner. The usage should be pretty similar to NUnit - you'll just need different namespaces.

Visual Studio 2012 Express Web ignores Unit Tests

a quickie, that you might already have solved :
I have a Test Project created in VS2010 SP1. The Project is imported into VS2012 Express. The Test Explorer Window shows no Tests (although there are two for now). So I click "run all", which results in the following Console Output (roughly translated, don't know the exact unlocalized equivalent) :
========== Build: 0 successful, 0 erroneous, 2 current, 0 skipped ==========
No Results, no Tests in Test Explorer...Any ideas?
TIA!
Obviously, the problem was based on the fact that the test class library was created in VS 2010. On the following screenshot,you can see the project that gets ignored by the VS 2012 test runner (bottom icon) and a newly created c# .Net 4.0 Test Project with all tests being executed as intended (topmost icon).