0
votes

Dear all, I'm trying to run the tests I developed with MbUnit v2 under Gallio. All from inside a NAnt script that is started via TeamCity (actually the CodeBetter installation of TeamCity).

The tests run on my local machine inside the GUI Gallio Runner named Icarus, but not when the runner is in Local mode, only if I specify "IsolatedAppDomain" or "IsolatedProcess".

It also runs locally from inside NAnt. This is the nant task definition I use:

<gallio result-property="ExitCode" failonerror="true"> 
    <files> 
        <!-- Specify the tests files and assemblies --> 
        <include name="${source.dir}\UnitTests.Subtext\bin\debug\UnitTests.Subtext.dll" /> 
    </files> 
</gallio> 

But then when I checked in everything and ran it from TeamCity the process fails with the following error:

[16:08:39]: [test] gallio (9s) 
[16:08:39]: [gallio] Gallio NAnt Task - Version 3.2 build 601 
[16:08:39]: [gallio] Start time: 9:08 AM 
[16:08:40]: [gallio] Initializing test runner.' 
flowId='cf40ac56f24b5b47 
[16:08:40]: [gallio] Running tests.' flowId='cf40ac56f24b5b47 
[16:08:46]: UnitTests.Subtext (2s) 
[16:08:48]: [UnitTests.Subtext] failed 
[16:08:48]: [UnitTests.Subtext] 
The test assembly setup failed. 
[16:08:48]: [gallio] [failed] MbUnit v2 Assembly UnitTests.Subtext 
The test assembly setup failed. 
[16:08:48]: [gallio] Disposed test runner.' flowId='cf40ac56f24b5b47 
[16:08:48]: [gallio] Stop time: 9:08 AM (Total execution time: 9.267 
seconds) 
[16:08:48]: 
Test Execution Failed

I tried changing the runner-type to all the 3 available runners (Local, IsolatedProcess, IsolatedAppDomain), but it doesn't run.

Local: seems like it can load the test, but finds no tests, so runs smoothly (but no tests are executed), this is also the default behavior I have on my local machine when running in Icarus

IsolatedProcess, IsolatedAppDomain: I get the error mentioned above.

I really have no clue on how I can debug this problem given the fact that I cannot connect to the machine and try running the tests manually. Any idea of what could be the problem?

Thank you

Simone

1
Do you have the MbUnit v2 Adapter Plugin set up? code.google.com/p/mb-unit/source/browse/trunk/v3/src/Extensions/…Mauricio Scheffer
BTW: upgrading to MbUnit v3 shouldn't be much of a problem, and it'll probably work smoother.Mauricio Scheffer
It works locally using the same configuration (all Gallio is on a subfolder of the source tree, so I guess it's the MbUnit should be set up). Is it something else other then having the MbUnit2Adapter in the Mbunit2 folder inside Gallio bin folder? And about the upgrade to MbUnit v3... I know it would benefit, but I don't want to change code in branches that have been released already just to make it run in the build serverCodeClimber
Can it be a problem of the tests being compiled in .NET 4 and Gallio process running on CLR 2?CodeClimber
.net 4 tests vs Gallio in CLR 2 -> definitely a problem :-) Don't remember how to set the host CLR version though...Mauricio Scheffer

1 Answers

1
votes

Found the answer to my problem:

The test assembly setup failed.

means that the code in the method tagged with the attribute [SetUp] in the assembly tagged with the AssemblyCleanup attribute failed.

In MbUnit you use these methods to perform some pre-test operations, like setting up databases or other things like that. In my scenario the setup of the testing database is probably failing.

Unfortunately the only way to understand why it fails it to attach a debugger to it, which is something I cannot do on the hosted version of TeamCity. I guess I'll have to change the way I create the database.