如何将phpunit coverage导出到xml(jenkins报告必需)

时间:2013-02-04 12:01:50

标签: jenkins phpunit

我正在使用phpunit和jenkins,关键是jenkins使用xml文件和测试结果创建报告,但我不知道如何导出到phpunit中的xml,现在我只看到了选项以HTML格式导出(用于报道)。

1 个答案:

答案 0 :(得分:1)

Sebastian Bergmann的

This project应该给你一些指示。它提到了PHPUnit的以下配置...

<logging>
 <log type="coverage-html" target="build/coverage" title="Name of Project"
      charset="UTF-8" yui="true" highlight="true"
      lowUpperBound="35" highLowerBound="70"/>
 <log type="coverage-clover" target="build/logs/clover.xml"/>
 <log type="junit" target="build/logs/junit.xml"
      logIncompleteSkipped="false"/>
</logging>

...所以我认为您应该尝试--coverage-clover而不是--coverage-html来获取XML文件。