使OpenCover报告在CruiseControl.NET中可用 [英] Make OpenCover reports available in CruiseControl.NET

查看:94
本文介绍了使OpenCover报告在CruiseControl.NET中可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 OpenCover ReportGenerator 的那些报告生成Xml和Html报告.

I'm trying to integrate OpenCover with CruiseControl.NET. At this point I've modified by build system so it runs my nunit tests under OpenCover. I then generate Xml and Html reports from those using ReportGenerator.

假设可以将ReportGenerator生成的报告集成到CruiseControl.NET Web应用程序中,如何将两者集成在一起?

Assuming it's possible to integrate the reports generated by ReportGenerator into the CruiseControl.NET webapp, how do I integrate the two?

NCover有它自己的 NCoverReporting任务,但与我一样'未运行NCover,我无法将其输出与OpenCover生成的XML报告进行比较.

NCover has it's own NCoverReporting task that can be used, but as I'm not running NCover I can't compare its output with the XML reports generated by OpenCover.

相关想法/问题:

  • OpenCover默认情况下会生成一个XML文件,但是cc.net可以使用该XML文件吗?
  • ReportGenerator还会生成XML,它们是否打算用于cc.net之类的东西?
  • cc.net具有一个文件合并发布者,它可以合并日志,但是我尚未找到任何文档来说明cc.net有用/使用的文件格式.
  • OpenCover generates an XML file by default, but is that XML file consumable by cc.net?
  • ReportGenerator also generates XML, are they intended for something like cc.net?
  • cc.net has a File-Merge publisher that merges logs, but I haven't yet found any documentation indicating which file formats are useful/used by cc.net.

推荐答案

我遇到了这个问题,并通过以下步骤解决了这个问题,请考虑到我正在使用msbuild,因此只有在使用msbuild时,此方法才有效:

I had this problem and I solved it with these steps, take into account that I'm using msbuild, so this will only work if you're using msbuild:

  1. 添加覆盖率目标
  2. 将一个任务添加到build.proj中,以创建OpenCoverage输出(OpenCoverReport.xml)
  3. 此后,添加一个使用以下命令创建摘要"报告的任务 ReportGenerator(报告类型:XML).像这样: MSBuild覆盖率目标示例
  4. 创建XSL转换以使用Summary.xml创建HTML输出,请放心,我已经编写了它:对于解析程序集级别的覆盖范围(在您的构建日志输出中),请使用以下命令:添加此内容到配置
  5. 将覆盖率报告摘要XML文件合并到ccnet.config文件中的Build输出中:将此添加到您的配置
  1. Add a Target for Coverage
  2. Add a task to your build.proj for creating the OpenCoverage output (OpenCoverReport.xml)
  3. Right after after that, add a task for creating the Summary report using ReportGenerator (reporttypes:XML). Like so: MSBuild Coverage Target Example
  4. Create the XSL Transforms for creating HTML output with the Summary.xml, don't worry I wrote it already: For parsing assembly level coverage (in your build log output) use the following: XSLT for an Assembly level coverage report and for parsing the Class level coverage (detailed report) use the following: XSLT for a Class level coverage report
  5. Add the buildReportBuildPlugin and xslReportBuildPlugin for creating both reports using the previous XSLT files in your dashboard.config file: Add this to the configuration
  6. Merge the coverage report summary XML file to the Build output, in your ccnet.config file: add this to your configuration

这篇关于使OpenCover报告在CruiseControl.NET中可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆