views:

1059

answers:

3

Hi

We currently don't format our msbuild output in CC.NET (CruiseControl.Net) and as a result, finding the cause of a broken build involves reading the XML to find the last 'success="false"' instance in the output.

What XSLT do you use to format your msbuild output, and are you happy with the resulting HTML? I.e. do you find it easy to identify the cause of a broken build?

Thanks b

EDIT: Here's a sanitised sample of one of our CC project XML elements. I'm now wondering whether the merge of logs is the issue.

    <project name="StackOverflowSample">
    <workingDirectory>D:\_300</workingDirectory>
    <webURL>&viewFarmReportWebURL;</webURL>
    <sourcecontrol type="multi">
        <sourceControls>
            <vsts>
                <!-- We get latest from TSF -->
            </vsts>
        </sourceControls>
    </sourcecontrol>
    <triggers>
        <intervalTrigger seconds="60" />
    </triggers>
    <tasks>
        <msbuild>
            <executable>&msbuildExecutable;</executable>
            <workingDirectory>app\consoleApp1</workingDirectory>
            <projectFile>consoleApp1.sln</projectFile>
            <buildArgs>/noconlog /p:Configuration=Release /v:quiet</buildArgs>
            <logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,"D:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"</logger>
        </msbuild>
        <nunit>
            <path>&nunitConsoleExecutable;</path>
            <assemblies>
                <assembly> D:\_300\app\consoleApp1\bin\Release\consoleApp1.exe</assembly>
            </assemblies>
        </nunit>
        <exec>
            <executable>&ncoverExecutable;</executable>
            <buildArgs>"&nunitConsoleExecutable;" "app\consoleApp1\bin\Release\consoleApp1.exe" /nologo</buildArgs>
        </exec>
        <exec>
            <executable>&ndependExecutable;</executable>
            <buildArgs>D:\_300\app\consoleApp1.xml /Silent</buildArgs>
        </exec>

        <merge>
            <files>
                <file>D:\_300\app\consoleApp1\unit-test.xml</file>
                <file>D:\_300\app\consoleApp1\ApplicationMetrics.xml</file>
                <file>D:\_300\app\consoleApp1\AssembliesBuildOrder.xml</file>
                <file>D:\_300\app\consoleApp1\AssembliesDependencies.xml</file>
                <file>D:\_300\app\consoleApp1\AssembliesMetrics.xml</file>
                <file>D:\_300\app\consoleApp1\CQLResult.xml</file>
                <file>D:\_300\app\consoleApp1\InfoWarnings.xml</file>
                <file>D:\_300\app\consoleApp1\NDependMain.xml</file>
                <file>D:\_300\app\consoleApp1\TypesDependencies.xml</file>
                <file>D:\_300\app\consoleApp1\TypesMetrics.xml</file>
            </files>
        </merge>
    </tasks>
    <publishers>
        <merge>
            <files>
                <file>D:\_300\app\consoleApp1\SymbolModule.Xml</file>
            </files>
        </merge>
        <xmllogger logDir="." />
        &emailconsoleApp1;
    </publishers>
</project>
A: 

It feels a bit wierd answering my own question, but there is a chance that someone might have the same question and appreciate my answer so here it is.

I visited the following page http://confluence.public.thoughtworks.org/display/CCNETCOMM/Improved+MSBuild+Integration that describes the use of a different logger than the traditional logger (normal logger produces very large files that bog the server down when performing the XSLT transformations).

The page provides the logger and an XSLT file along with simple and clear instructions on how to incorporate this into your CC.Net project. I tried this logger and XSLT and found I was still getting the raw XML; in fact, ALL of the XML combined in one HUGE page.

Bernhard Hofmann
+1  A: 

After a conversation the developers (I have been told that the alternative logger you link to is quite old and it's usage is discouraged), I am using the default, standard logger and xslt. If it does cause problems for you, please report a bug on CruiseControl.Net Jira, the more people vote on this the sooner someone with commit access to the code might look into it.

"View Build Log" is a raw view, not usable except for debugging the build server setup - for some of my project this is almost 5MB large and does not cause any problems for the server (although opening it hangs the browser for a while). NCover can cause problems inflating buildlog.xml to over 100MB - you have to use NCoverExplorer to analyze the results before merging them if this happens(but don't bother before you start getting exceptions from the server).

To see the formatted MSBuild results in the WebDashboard, make sure that the dashboard configuration includes msbuild.xsl (this will give you a link to "MSBuild Report" on ViewBuildReport page and include some basic information on the page itself).

skolima
Thanks for the link. I've up-voted your answer but I cannot mark it as a resolution ... yet. ;)I've opened the link you provided and will investigate. I do think the custom logger is a good approach because, if I wrote one, it could allow filtering of noise to produce much smaller logs that transform more quickly and with less drain on the CI server.
Bernhard Hofmann
I don't fully understand - the 'default' logger is still custom, written specially for CCNet. If Rodemeyer's one performs better, then it should probably replace the 'default' in the distribution. But most of the wiki article is outdated, ThoughtWorks.CruiseControl.MsBuild.XmlLogger no longer results in such garbled output.
skolima
Thanks for your persistence on this; I really appreciate it. In the web dashboard, when I choose "View Build Log", I see a MASS of XML. It starts with the msbuild output, then followed by NUnit output, and then a MONSTER of XML from NCover and NDepend. Is this the real problem? Should I have a link to msbuild output? Should the outputs not be merged? I'll update the question with our project xml so you can see in more detail what we're doing.
Bernhard Hofmann
I have updated my answer, does this help?
skolima
Bernhard Hofmann
+2  A: 

I've tried CruiseControl.Net 1.4.4.83 with Rodemeyer.MsBuildToCCnet.dll 1.0.0.5 as a logger coupled with msbuild2ccnet.xsl, and the output is nothing like the output samples from the article:

Build started
Project "" (Integration.Common.csproj target(s)):
error CS1002: 
Build succeeded
error CS1002: 
1 Error(s)
0 Warning(s)
Time elapsed

Using ThoughtWorks.CruiseControl.MSBuild.dll as a logger coupled with msbuild.xsl, the results are just fine:

Build started 07/16/2009 13:46:38
Person.cs (18,53):  error CS1002: ; expected
Build FAILED
Person.cs (18,53):  error CS1002: ; expected
1 Error(s)
0 Warning(s)
Time elapsed 00:00:00
alexandrul