Reporting build progress after NUnit launcher does not work

Hi,

1)
I noticed that reporting build progress does not work after I use NUnit launcher. Progress messages called before NUnit are displayed. Progress messages called after NUnit launcher are not displayed.

Runner: MsBuild
NUnit launcher appoach: <NUnit> MSBuild task
<UsingTask TaskName="NUnit" AssemblyFile="$(teamcity_dotnet_nunitlauncher_msbuild_task)" Condition="'$(agent_name)' != ''" />
    <NUnit
      Assemblies="@(TestBinaries)"
      NUnitVersion="NUnit-2.5.7"
      Condition="'$(agent_name)'!=''"
      ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="NUnitExitCode"/>
    </NUnit>

Progress messages :
<Message Text="##teamcity[progressStart 'Running SmokeTest...']" Condition="'$(agent_name)' != ''" />
...
<Message Text="##teamcity[progressFinish 'Running SmokeTest...']" Condition="'$(agent_name)' != ''" />


2)
I noticed that when there are failed unit tests launched by NUnit launcher, teamcity always breaks the build (even when msbuild script exits with 0 exit code)

Any ideas how can I fix or workaround mentioned issues?

Regards!

5 comments
Comment actions Permalink

1. Please try removing output parameter from the task as workaround.
2. In the General setting of the build configuration you may find a checkbox to control if the build should be failed if there were failed tests.

Please attach the build log.

0
Comment actions Permalink

Hi,

Thank you for the answer.

> 1. Please try removing output parameter from the task as workaround.
I have tried your suggestion but it did not help. After Output parameter removal I still was not able to get any service messages called after NUnit launcher. In my scenario I
     a) run compilation

     b) run fxcop - service message works
          <Message Text="##teamcity[progressStart 'Running FxCop...']" Condition="'$(agent_name)' != ''" />
          ...
          <Message Text="##teamcity[progressFinish 'Running FxCop...']" Condition="'$(agent_name)' != ''" />

     c) run TeamCity NUnit launcher - progress message shows "Tests passed: 233"
       <Target Name="UnitTesting" DependsOnTargets="Compilation">

    <MSBuild.Community.Tasks.NUnit
      ToolPath="$(ToolNUnitFolder)"
          ErrorOutputFile="$(NUnitXmlErrorReport)"
          OutputXmlFile="$(NUnitXmlReport)"
          Assemblies="@(TestBinaries)"
          Condition="'$(agent_name)'==''"
      ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="NUnitExitCode"/>
    </MSBuild.Community.Tasks.NUnit>

    <NUnit
      Assemblies="@(TestBinaries)"
      NUnitVersion="NUnit-2.5.7"
      Condition="'$(agent_name)'!=''"
      ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="NUnitExitCode"/>
    </NUnit>

    <Message Text="NUnitExitCode: $(NUnitExitCode)" />

  </Target>

     d) run instaler - service messages do not work and show "Tests passed: 233"
          <Message Text="##teamcity[progressStart 'Creating installer...']" Condition="'$(agent_name)' != ''" />
          ...
          <Message Text="##teamcity[progressStart 'Creating installer...']" Condition="'$(agent_name)' != ''" />

     e) run smoke test - service message do not work and show "Tests passed: 233"
              <Message Text="##teamcity[progressStart 'Running SmokeTest...']" Condition="'$(agent_name)' != ''" />
               ...
               <Message Text="##teamcity[progressFinish 'Running SmokeTest...']" Condition="'$(agent_name)' != ''" />

So after NUnit launcher service messages hangs on NUnit launcher results

> 2. In the General setting of the build configuration you may find a  checkbox to control if the build should be failed if there were failed  tests.
It helped, thanks.

>Please attach the build log.
Log in the attachement



Attachment(s):
SMS_Net_test_0.0.5.0.log.zip
0
Comment actions Permalink

I would like to add that if I remove NUnit task further progress messages are shown correctly.

0
Comment actions Permalink

Unfortunately, this is a known issue.
Please vote for related issues at
http://youtrack.jetbrains.net/issue/TW-5371
http://youtrack.jetbrains.net/issue/TW-5370

Does the issues covers your case?

0
Comment actions Permalink

Hi,

http://youtrack.jetbrains.net/issue/TW-5371 seems to descibe desired behaviour.
http://youtrack.jetbrains.net/issue/TW-14004 which has state "Duplicate TW-5371" describes exactly identical issue.

So i voted for TW-5371

Regards!

0

Please sign in to leave a comment.