joaquimcid / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Icarus with MSTest #570

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I’m having trouble getting Icarus to run MSTest tests.  I’m using VSTS 
2008, and just installed the latest Gallio 3.1.367.  I’m running Vista x64 
with latest SPs, but I get the same error running XP with latest SP’s.

I get the following message: “Cannot run tests because the MSTest 
executable was not found”

In the About box for Icarus there is no version number next to MSTest.

I’ve tried copying the MSTest.exe and config to the following directories 
and nothing works:
• C:\Program Files
• C:\Program Files (x86)\Gallio
• C:\Program Files (x86)\Gallio\bin
• C:\Program Files (x86)\Gallio\bin\MSTest
• Dir where my test DLL lives

How do I get Icarus to run MSTest?

Original issue reported on code.google.com by bradi...@gmail.com on 26 Oct 2009 at 7:25

GoogleCodeExporter commented 8 years ago

Original comment by jeff.br...@gmail.com on 29 Oct 2009 at 7:29

GoogleCodeExporter commented 8 years ago
Issue 574 has been merged into this issue.

Original comment by jeff.br...@gmail.com on 29 Oct 2009 at 7:29

GoogleCodeExporter commented 8 years ago
No copying should be needed.  Gallio finds MSTest using the registry.

I've just found the bug on x64 platforms and will fix it shortly.

Original comment by jeff.br...@gmail.com on 29 Oct 2009 at 7:31

GoogleCodeExporter commented 8 years ago
Is there a workaround I can use in the meantime?  All I've got now is the built 
in 
MSTest runner and it's very slow.

Original comment by bradi...@gmail.com on 30 Oct 2009 at 5:42

GoogleCodeExporter commented 8 years ago
Let's just say it is fixed in trunk and will be in the next build.  
Unfortunately I
broke the build server last night.

If you can tolerate MSTest in VSTT for one more day then expect good news later
tonight.  :-)

Original comment by jeff.br...@gmail.com on 30 Oct 2009 at 5:48

GoogleCodeExporter commented 8 years ago
Please try the latest v3.1 (NOT v3.2) build in 
http://ccnet.gallio.org/Distributables.

Original comment by jeff.br...@gmail.com on 2 Nov 2009 at 10:29

GoogleCodeExporter commented 8 years ago
I just uninstalled gallio and installed 3.1.375 and I'm still getting the same 
error.  Note that i'm getting the same error on 32bit XP so it's probably not 
an x64 
error.

Original comment by bradi...@gmail.com on 2 Nov 2009 at 11:44

Attachments:

GoogleCodeExporter commented 8 years ago
Ok, time to find a new hypothesis!

Gallio finds MSTest by reading the value of
"HKLM\SOFTWARE\Microsoft\VisualStudio\*.0\@InstallDir" and looking for 
MSTest.exe in
that directory.  The version number is based on the version of the QualityTools
framework that the tests were linked with.

Original comment by jeff.br...@gmail.com on 3 Nov 2009 at 8:36

GoogleCodeExporter commented 8 years ago
That was a step in the right direction.  That reg key didn't exist so I added 
it 
(see my before and after .reg files attached).  I'm getting past the "can't 
find 
mstest" error, but now i'm getting a diff error (screen shots attached).

Original comment by bradi...@gmail.com on 3 Nov 2009 at 8:15

Attachments:

GoogleCodeExporter commented 8 years ago
On x64 the key is in HKLM\Software\Wow6432Node\VisualStudio\...
But I just found the bug as to why it wasn't looking there.  Doh!  I'll make 
sure to
fix that.

As for the MSTest output, it is really bizarre but I have a possible 
explanation.  I
think it may be trying to run MSTest as a 64bit process but it doesn't look like
MSTest supports that behavior.  We might need to force the process bitness to 
32bit.

Here's something to try as a workaround.  Compile your test assembly using an 
"x86"
configuration.  Gallio will automatically detect that your tests are 32bit and 
will
run them in a 32bit process.

I'm glad you found this problem.  I doubt it's something I would have 
discovered on
my own.  Long term I will need to update the CI build to the Gallio tests on 
both
32bit and 64bit platforms.

Original comment by jeff.br...@gmail.com on 3 Nov 2009 at 9:12

GoogleCodeExporter commented 8 years ago
I looked for that reg entry and found it, so that seems ok.

I reset the test prj to x86 (code under test still Any CPU) and now i'm getting 
a 
different error (attached).  It did recognize the DLL, though, so it's 
progress.  
I'll try setting all the code to x86 but there are about 100 projects in this 
solution so it may take me a while to get to that.

BTW, the error says "exception thrown" but all these tests pass in both MSTest 
and 
running by hand with TestRunner.

Original comment by bradi...@gmail.com on 3 Nov 2009 at 9:45

Attachments:

GoogleCodeExporter commented 8 years ago
one more thing - i get this error every time i shut down Icarus.

Original comment by bradi...@gmail.com on 3 Nov 2009 at 9:47

Attachments:

GoogleCodeExporter commented 8 years ago
The latter problem is due to some silliness of IE on x64.  It's trying to load 
the
Flash plug-in but fails which shouldn't be a big deal except for that stupid 
dialog
that shows up on exit.  But there is no x64 Flash plug-in.

Anyways, the other problems with MSTest on x64 should be fixed in recent builds.

Original comment by jeff.br...@gmail.com on 7 Nov 2009 at 8:56