You are using the exec task for running MSTest - this checks the exit code
of the application to set whether the build passes or fails. By default,
CC.Net assumes an exit code of 0 (zero) means success, everything else is a
failure.

This can be changed by setting the <successExitCodes> as described in help:
http://confluence.public.thoughtworks.org/display/CCNET/Executable+Task.


Craig

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of tracstarr
Sent: Sunday, 22 March 2009 3:24 p.m.
To: ccnet-user
Subject: [ccnet-user] MSTest as separate ccnet project - marked as Failed
when all tests Pass


I currently have a ccnet project setup that just runs the MSTest for
my build. It's triggered on the actual project build. The project runs
fine, however, I cannot figure out how ccnet decideds that the build
has "failed" or "passed". All tests pass and ccnet still reports that
the build "fails". What am i missing. Below is my ccnet project.

<project name="RCAP2_Tests" queue="Tests" queuePriority="1">
                <labeller type="stateFileLabeller" >
                        <project>RCAP2_Continuous</project>
                </labeller>

                <triggers>
                        <projectTrigger project="RCAP2_Continuous"  />
                </triggers>
        
<workingDirectory>$(BaseDir)\RCAP2_Continuous\WorkingDirectory</
workingDirectory>

                <prebuild>
                        <exec>
                                <baseDirectory>c:\Temp</baseDirectory>
                                <executable>CMD</executable>
                                <buildArgs>/C DEL
"%ccnetworkingdirectory%\testResults.trx" /S /Q</
buildArgs>
                        </exec>
                </prebuild>

                <tasks>
                        <exec>
                                <executable>C:\Program Files (x86)\Microsoft
Visual Studio
9.0\Common7\IDE\mstest.exe</executable>
        
<buildArgs>/testcontainer:OMJUS_RCAP2_Tests\bin\debug
\OMJUS_RCAP2_Tests.dll /runconfig:LocalTestRun.testrunconfig /
resultsfile:testResults.trx</buildArgs>
        
<buildTimeoutSeconds>600</buildTimeoutSeconds>
                        </exec>
                </tasks>
                <publishers>
                        <!--to get the test results in the dashboard we have
to merge the
results XML file -->
                        <!--the project working directory is used as the
base path here -->
                        <merge>
                                <files>
                                        <file>testResults.trx</file>
                                </files>
                        </merge>
                        <xmllogger/>
                        <artifactcleanup   cleanUpMethod="KeepLastXBuilds"
cleanUpValue="100" />
                        <statistics>
                                <statisticList>
                                        <statistic name='TestFailures'
xpath='sum(//@failed)' />
                                        <statistic name='TestIgnored'
xpath='sum(//@inconclusive)'/>
                                        <statistic name='TestCount'
xpath='sum(//@total)' />
                                </statisticList>
                        </statistics>

                        <email mailhost="xxxx" from="xxx"
includeDetails="true"
                        mailport="587" mailhostUsername="xxx"
mailhostPassword="xxx"
useSSL="true">
                                <users>
                                  <!--<user name="xxx" group="buildmaster"
address="xxx"/>-->
                                  <user name="RCAP2" group="developers"
address="xxx"/>
                                </users>
                                <groups>
                                  <group name="developers"
notification="Failed"/>
                                  <group name="buildmaster"
notification="Failed"/>
                                </groups>
                        </email>
                </publishers>
        </project>

Reply via email to