Click here to Skip to main content
15,885,767 members
Articles / All Topics

CruiseControl.Net and MSTest

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
13 Oct 2010CPOL1 min read 23.2K   3   1
CruiseControl.Net and MSTest

I wanted to put together some notes about CruiseControl.Net and MSTest to have it as reference:

First, to be able to generate reports, the following element is required on ccnet.config file.

XML
<xmllogger />

This element is used to create the log files read by the CruiseControl.NET web page, if it isn't defined, the web page will throw the following error:

Exception Message
Request processing has failed on the remote server: Unable to find Log Publisher for project so can't find log file.

To view the MSTest report, we need to add the result file in ccnet.config to merge the content in the build report, for example:

XML
..................
<exec>
  <executable>C:\Program Files 
  (x86)\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe</executable>        
  <baseDirectory>.\</baseDirectory>
  <buildArgs> /testcontainer:SeleniumSearch\bin\Debug\SeleniumSearch.dll 
  /resultsfile:Results\results1.trx</buildArgs>
</exec>     
tasks>
<publishers>
<merge>
  <files>
    <file>.\Results\results1.trx</file>
  </files>
</merge> 
<xmllogger />
</publishers>
..................

Include the MSTest plug in to generate the report on the web page, for example, dashboard.config file.

XML
..................
<buildPlugins>
  <buildReportBuildPlugin>
    <xslFileNames>
      <xslFile>xsl\header.xsl</xslFile>
      <xslFile>xsl\modifications.xsl</xslFile>
      <xslFile>xsl\MsTestSummary2008.xsl</xslFile>          
    </xslFileNames>
  </buildReportBuildPlugin>
  <buildLogBuildPlugin />
  <xslReportBuildPlugin description="MSTest2008 Report" 
  actionName="MSTESTReport" xslFileName="xsl\MsTestReport2008.xsl"/>             
</buildPlugins>
..................

And include the xls file for MSTest report on ccservice.exe.config/ccnet.exe.config.

XML
..................
<!-- Specifies the stylesheets that are used to transform the build results 
when using the EmailPublisher -->
<xslFiles>
    <file name="xsl\header.xsl"/>
    <file name="xsl\compile.xsl"/>
    <file name="xsl\unittests.xsl"/>
    <file name="xsl\MsTestSummary2008.xsl"/>        
    <file name="xsl\fit.xsl"/>
    <file name="xsl\modifications.xsl"/>
    <file name="xsl\fxcop-summary_1_36.xsl"/>
</xslFiles>
..................

The xls used in the above example is the one included in ccnet installation. I tested the report generation running tests on VS 2010 and VS 2008 and both reports are generated correctly. The only thing that caused issues was having MSTest on the path windows environment variables on a computer that has both VS 2010 an VS 2008.

Also, if MSTest needs to connect to external resources, like accessing remote files or connecting to SQL Server, make sure the account that runs CruiseControl.Net Server windows service (by default is Local System Account) has access to those resources.

This article was originally posted at http://mariangemarcano.blogspot.com/feeds/posts/default

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Denmark Denmark
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralCCNet XmlConfig Plugin Pin
void leenux();16-Apr-11 7:11
void leenux();16-Apr-11 7:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.