chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
I've run into an odd one while in the process of moving from the Gallio test runner (Gallio.Echo.exe) to the NUnit runner included in TeamCity (JetBrains.BuildServer.NUnitLauncher.exe): One test always throws an error.

If I remove the failing test, another test will fail. I keep removing the failing tests one by one and every time one other test will always throw an error.

I've tried using the TMockRunner:
TMockRunner.exe -target 4.0 JetBrains.BuildServer.NUnitLauncher.exe v4.0 x64 NUnit-2.5.10 AssemblyToTest.dll
...
Tests run: 498, Errors: 1, Failures: 0, Inconclusive: 0 Time: 29,390681 seconds

And I've tried using mocking_on.bat:
mocking_on.bat
JetBrains.BuildServer.NUnitLauncher.exe v4.0 x64 NUnit-2.5.10 AssemblyToTest.dll
...
Tests run: 498, Errors: 1, Failures: 0, Inconclusive: 0 Time: 29,390681 seconds

Running with nunit-console.exe works fine:
TMockRunner.exe -target 4.0 nunit-console.exe AssemblyToTest.dll
...
Tests run: 498, Errors: 0, Failures: 0, Inconclusive: 0, Time: 21,3462209 second

Running with Gallio.Echo.exe works fine:
Gallio.Echo.exe /runtime-version:v4.0.30319 /runner:TypeMock AssemblyToTest.dll
...
498 run, 498 passed, 0 failed, 0 inconclusive, 0 skipped

The error is always (with a different name for the failing mocked method as I keep on removing tests):
TypeMock.TypeMockException : 
*** Cannot return a value for DatesDataManager.get_Instance() because no value was set. use recorder.Return().
*** Note: Cannot mock unsupported types from mscorlib assembly. See supported types here: https://www.typemock.com/mscorlib-types
   at bh.c()
   at TypeMock.RecordExpectations.Dispose()

How can I get JetBrains.BuildServer.NUnitLauncher.exe to work?

(Using TypeMock v6.2.5 and TeamCity is v7.0)
asked by halstein (8.7k points)

3 Answers

0 votes
Hi,
This is a known issue with Jetbrains nunit runner.
As you already discovered the workaround is to run nunit-console.exe with TMockRunner.exe :)
Do you have any problem doing it this way?
answered by ohad (35.4k points)
0 votes
The reason I wanted to use TeamCity's own runner was that it will automatically report the test results to TeamCity and one can see the test results counting up as the tests are running. With the nunit-console we have to generate the XML report and get it into TeamCity ourselvest and we won't see any results until the tests are all done.

I will continue running the tests using the Gallio.Echo runner as that does everything I want (but takes twice as long to run the tests).

Is the bug in TeamCity NUnit runner or in TypeMock? If it is in the TeamCity NUnit runner I can post a bug report with Jetbrains. (Wouldn't it be epic if TeamCity would nativly support TypeMock WITH coverage directly from the UI? Just choose TypeMock as mocking framework, input the path where TypeMock is and input the license information for auto deploying. TeamCity would then use this to register TypeMock, run the tests and undeploy TypeMock...*dreamy sigh*)
answered by halstein (8.7k points)
0 votes
I retried with TeamCity 7.0.2 and TypeMock 7.0.5 and this time it just worked. Seems like this issue is no longer an issue.
answered by halstein (8.7k points)
...