TeamCity MSBuild Gallio NCover Reporting

5

我是一个完全的构建系统新手。我已经抽出了两个星期的时间来尝试这个,但是一直没有解决,现在我觉得需要新的思路。我的最终目标是在我的TeamCity构建项目中生成一个新的NCover覆盖率报告(至少是摘要报告)。

我尝试过各种方式,包括在线演示、NCover官方提供的Extras以及大量阅读,但我已经有些困惑了!我在我的MSBuild脚本中有以下任务:

<Target Name="TestCoverage">
    <Message Text="Test Assemblies @(TestAssemblies)" />
    <Gallio RunnerType="NCover" 
            IgnoreFailures="true"
            Files="@(TestAssemblies)"
            ReportDirectory="Reports"
            ReportTypes="xml"
            ReportNameFormat="gallio_cover"
            RunnerProperties="NCoverCoverageFile='$(MSBuildProjectDirectory)\Reports\codecoverage.xml'; 
                              NCoverArguments='//w %(TestAssemblies.RootDir)%(TestAssemblies.Directory) CoverageExcludeAttribute //ea //r:Local'" >
        <Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
    </Gallio>
</Target>

我在生成的gallio_cover.xml报告中看到的错误信息是:
<logEntry severity="info" message="Connected&#xA;Profiled process terminated. Profiler connection not established." />
<logEntry severity="error" message="Host process exited with code: 1" />

我从上一条消息中剪掉了很多内容。

我看到了很多不同的例子,说明了应该如何通过Gallio调用NCover,但我似乎无法找出问题所在。

是否有任何想法或建议将不胜感激。

谢谢,

詹姆斯。


为什么不像http://weblogs.asp.net/lkempe/archive/2008/03/30/integration-of-ncover-into-team-city-for-tech-head-brothers.aspx中那样将NCover作为自己的构建任务运行呢?我在这里错过了什么吗? - Chris McCall
嗨,Chris,目前我的测试是使用xUnit编写的,我认为NCover需要NUnit控制台应用程序。因此,我实际上正在尝试使用xUnit控制台应用程序进行这件事情,到目前为止我还没有看到有人这样做过。 - Jammer
1个回答

2
NCover可以执行任何测试框架。我们只需要知道要调用哪个应用程序以及该应用程序的参数。
你有阅读将NCover与TeamCity集成的相关信息吗?

http://docs.ncover.com/how-to/continuous-integration/teamcity/

如果您有任何问题,请随时联系支持团队。
谢谢,
Joe Feser NCover

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接