Hi Craig,

thank you so much for guiding me towards the right direction. I search
for the mstest and exit code and found the following article and it
solved the problem.

http://modelus.com/Blog/post/2009/04/06/How-to-automatically-fail-TeamCity-build-when-webtests-fail.aspx

i added the following line as the last line in my batch file

if not %errorlevel% == 0 exit 1

solved the problem

thanks

kazim



On Jun 15, 1:00 pm, "Craig & Sammi Sutherland"
<cj.sutherl...@xtra.co.nz> wrote:
> You need to return the exit code from the mstest in the batch. Otherwise it
> just ignores it and CC.NET thinks the task was successful.
>
> Craig
>
> -----Original Message-----
> From: ccnet-user@googlegroups.com [mailto:ccnet-u...@googlegroups.com] On
>
> Behalf Of kazim mehdi
> Sent: Monday, 15 June 2009 10:17 p.m.
> To: ccnet-user
> Subject: [ccnet-user] Mstest: test failed but build passed?
>
> Hi
>
> I am using version : 1.4.3.4023 , i added mstest as a executing task
> to the project . i am able to execute the mstest but the build is not
> breaking when the test fails below is the extract of the exec section.
>
> <exec>
>         <description>Executing unit tests </description>
>         <buildTimeoutSeconds>1800</buildTimeoutSeconds>
>         <executable>c:\MyTests\RunTests.bat</executable>
>         <baseDirectory>c:\MyTests\Tests</baseDirectory>
>         <successExitCodes>0</successExitCodes>
>       </exec>
>
> contents of RunTests.bat
> ===================
> if exist results.xml del results.xml
>
>  "mstest.exe" /testcontainer:Bin\MyTests.Tests.dll /noisolation /
> resultsfile:results.xml
>
> any suggestion.
>
> thank you
>
> kind regards
> kazim

Reply via email to