tags:

views:

194

answers:

1

Hi All,

I have integrated MSTest with cruise control for single project by following the steps present in the below link.Its working fine http://www.codeproject.com/KB/tips/VSTS2008_Tests_With_CCNET.aspx?display=Print.

But if i add multiple projects, the result file is getting over wrtitten by 2nd project result. I am not able to see the first project result.

Please let me know how i can display multiple project results in result fie.

+1  A: 

... in the meantime I checked the problem in more detail and it seems that my 1st guess was right (although I didn't realize that no real build script but a simple batch is used):

Problem: A single working directory is used for all projects. Each project produces it's own results.xml file but since they are all stored in the same location results are overwritten.

Solution: Use a separate folder for the results of each project (e.g. the project's artifact directory which is passed from CruiseControl to the batch process as environment variable).

RunTests.bat:

del "%CCNetArtifactDirectory%\results.xml"
MSTest.exe /testcontainer:<PathtoTestProject>\Bin\Debug\TestAssembly.dll /resultsfile:"%CCNetArtifactDirectory%\results.xml"

ccnet.config:

<project name="ProjectA">
    <cb:define projectArtifactDirectory="C:\path\to\data\of\ProjectA" />
    ...
    <artifactDirectory>$(projectArtifactDirectory)</artifactDirectory>
    ...
    <publishers>
        <merge>
            <files>
                <file>$(projectArtifactDirectory)\results.xml</file>
            </files>
        </merge>
    </publishers>
    ...
</project>
The Chairman