On Friday, October 12, 2012 5:32:50 PM UTC+1, Alessandro Riolo wrote:

>
> I have got a few CCNet 1.6.7981.1 services running.
>
> I have noticed that on certain runs, we are reported a build success when 
> in reality some unit tests have failed.
>
> The CCNet tasks look like this:
>
> ...
>
>
> We can see this in the logs:
>
> ...
>> <msbuild startTime="10/12/2012 11:17:43" elapsedTime="00:00:50" 
>> elapsedSeconds="3170" success="*true*"> ... WebService,Slow" *exited 
>> with code -100*.]]> ...
>
> Am I right to conjecture this is a bug in this version of CCNet? Or is it 
> something in our configuration?
>
>
We found out the issue was with our MSBuild configuration.

The targets running the unit tests were checking for an exit code of the 
nunit console greater than zero:

<Target Name="CompanyApplicationIntegrationUnitTests">
<Exec
ContinueOnError='true'
Command='$(NUnitConsoleEXE) $(NUnitArgs) 
Company.Application.Integration.UnitTests.dll 
/exclude:$(NUnitCommonExclusion)'
WorkingDirectory='$(UserInterfaceDir)\Company.Application.Integration.UnitTests\bin\$(Configuration)\'>
<Output TaskParameter='ExitCode' ItemName='ExitCodes' />
</Exec>
<Error Text='Unit Test(s) error(s) occurred' 
Condition="'%(ExitCodes.Identity)'*>*0"/>
</Target>

We changed those to check for an exit code different from zero:

<Error Text='Unit Test(s) error(s) occurred' 
Condition="'%(ExitCodes.Identity)'*!=*0"/>

Et voila, it started to report the build success or failure correctly.

-- 
ale
http://ale.riolo.co.uk 

Reply via email to