0

I have a msbuild project like below, through which I am running unit tests under typemock isolation.

<PropertyGroup>
    <NunitOutputCode>0</NunitOutputCode>
</PropertyGroup>
<ItemGroup>
      <UnitTestAssemblies Include="$(PathOutputAssemblies)\*.UnitTests.dll"/>
</ItemGroup>

<TypeMock.MSBuild.TypeMockStart />
    <Exec Command='"C:\program files (x86)\NUnit 2.5.8\bin\net-2.0\nunit-console.exe" /nologo /noshadow /labels "@(UnitTestAssemblies)"  /exclude=SpecialEnvironmentNeeded,FailingToBeAddressed,NotApplicationTest,PerformanceTest'
          WorkingDirectory="%(RootDir)%(Directory)"
          ContinueOnError="true">
    <Output TaskParameter="ExitCode" PropertyName="NunitOutputCode"/>
    </Exec>
<TypeMock.MSBuild.TypeMockStop />

However, when I run this, the unit tests run and then the process just hangs, never returns. I see the output as below in the console when it is hung.

Tests run: 9, Errors: 0, Failures: 0, Inconclusive: 0, Time: 1.1281699 seconds
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0

This makes me to believe my tests are running fine, but the issue might be returning the exit code. Any idea what might be happening here?

utkarsh
  • 588
  • 1
  • 7
  • 18
  • Desclaimer, I work at Typemock. You can run this with Typemock logs enabled. Like this: and send the logs to support@typemock.com – Al.exe Mar 13 '16 at 09:22
  • @Al.exe thank you. As mentioned in answer below, it turned out to be not a typemock issue. – utkarsh Mar 14 '16 at 16:06

1 Answers1

0

This turned out to be not a Typemock issue. It was due to Nunit agent version we were using.

We have a old v2.5.8 version of Nuget and it defaults to using .net framework 2.0. The trick was to modify the agent config file as mentioned in this answer to refer to .net framework 4.0. This resolved the issue for me.

Community
  • 1
  • 1
utkarsh
  • 588
  • 1
  • 7
  • 18