views:

29

answers:

1

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

A: 

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.

CodeClimber