CruiseControl.NET Visual Studio测试用例未显示在仪表板上

时间:2010-07-02 03:37:26

标签: cruisecontrol.net

我正在使用CruiseControl.NET在项目构建后运行visual studio测试用例。在原始xml日志中,我可以看到它运行测试用例并说明哪个通过了哪个失败了,但是在CruiseControl仪表板上它只是说:

9个项目完全没有警告:-) Juchuu !!!

这是我的项目块的样子:

<project name="projectname" queue="queuename" queuePriority="2">
    <workingDirectory>C:\Build</workingDirectory>
    <category>categoryname</category>
    <webURL>http://myurl/ViewProjectReport.aspx</webURL>
    <triggers>
      <intervalTrigger seconds="60" />
    </triggers>
    <modificationDelaySeconds>60</modificationDelaySeconds>
    &sc;
    <tasks>
      <msbuild>
        <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
        <workingDirectory>C:\mypath</workingDirectory>
        <projectFile>project.sln</projectFile>
        <buildArgs>/v:quiet /noconlog /p:Configuration=Debug</buildArgs>
        <targets>Build</targets>
        <timeout>900</timeout>
        <logger>C:\Program Files\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll</logger>
      </msbuild>
      <exec>
        <executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe</executable>
        <baseDirectory>C:\Build\Test\TestCases\</baseDirectory>
        <buildArgs>/testcontainer:testproject\bin\debug\testproject.dll /runconfig:localtestrun.Testrunconfig</buildArgs>
        <buildTimeoutSeconds>900</buildTimeoutSeconds>
      </exec>
    </tasks>
    <publishers>
      <xmllogger logDir="C:\Program Files\CruiseControl.NET\Logs\Navtrak\H4CommandProcess\" />
    </publishers>
  </project>

如何让已通过/未通过的测试用例显示在该特定版本的cruisecontrol仪表板页面上?

谢谢, 贾斯汀

1 个答案:

答案 0 :(得分:0)

有关如何将MSTest结果显示在CruiseControl.Net中的一些提示,请参阅此文章:

http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+MSTest

基本上你需要做的是:

  • 获取MSTest将其测试结果保存到xml(.trx)文件(您的原始构建输出可能会以测试格式显示测试结果,但CruiseControl.net需要xml格式的结果)
  • 获取CruiseControl.Net将此xml文件合并到巡航控制构建日志中。
  • 添加一个额外的构建报告,该报告使用XSLT显示将xml测试结果转换为漂亮的HTML。

上面的文章详细介绍了如何执行此操作,以及一些额外的注意事项(例如删除旧的测试结果)。

另外,我注意到您使用的是Visual Studio 2009 - 上面的文章没有强调的是当您设置仪表板以显示MSTest结果时,您需要确保使用VS2009特定的xslt在CruiseControl.Net directroy中,标准版不会在仪表板上显示任何结果。

相关问题