Skip to content
This repository

Unable to generate coverage-xml report. #135

Closed
theOwner opened this Issue · 5 comments

2 participants

theOwner Sebastian Bergmann
theOwner

Hi.

I can not find the information in the documentation so I treat it as a bug - I can not generate a report in XML format without generating a report in HTML format. Below configuration that I use. Removing log type = 'coverage-html causes the lack of both reports, adding it generates both reports correctly.

If there is no such functionality I ask for adding it.

Please add "summary" report type - generating a complete HTML each time is not needed - a summary of the percentage how much lines of is covered in the code is enough (full html need 2gb of ram :/ and takes forever).

Version used: 3.5.0 and 3.5.10

Best regards
Grzegorz

Sebastian Bergmann

The two reports are separate from each other, you can generate one without generating the other. Closing, because there is no bug here. If you need further help, ask on the mailinglist.

theOwner

Sorry - I forgot to add the configuration in which I wrote in the report.

Both reports are generated



No report is generated



Not even "Generating code coverage report, this may take a moment."

Sebastian Bergmann

I cannot reproduce this:

sb@vmware object-freezer % cat phpunit.xml.dist 
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         syntaxCheck="false">
  <testsuites>
    <testsuite name="Object_Freezer">
      <directory suffix="Test.php">Tests</directory>
    </testsuite>
  </testsuites>

  <php>
    <const name="OBJECT_FREEZER_COUCHDB_HOST" value="localhost"/>
    <const name="OBJECT_FREEZER_COUCHDB_PORT" value="5984"/>
  </php>

  <logging>
    <log type="coverage-clover" target="build/logs/clover.xml"/>
    <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
  </logging>

  <filter>
    <whitelist addUncoveredFilesFromWhitelist="true">
      <directory suffix=".php">Object</directory>
       <exclude>
         <file>Object/Freezer/HashGenerator.php</file>
         <file>Object/Freezer/IdGenerator.php</file>
       </exclude>
    </whitelist>
  </filter>
</phpunit>

sb@vmware object-freezer % phpunit             
PHPUnit 3.5.10 by Sebastian Bergmann.

................................................................. 65 / 81 ( 80%)
................

Time: 5 seconds, Memory: 11.50Mb

OK (81 tests, 174 assertions)

Writing code coverage data to XML file, this may take a moment.


sb@vmware object-freezer % cat phpunit.xml.dist
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         syntaxCheck="false">
  <testsuites>
    <testsuite name="Object_Freezer">
      <directory suffix="Test.php">Tests</directory>
    </testsuite>
  </testsuites>

  <php>
    <const name="OBJECT_FREEZER_COUCHDB_HOST" value="localhost"/>
    <const name="OBJECT_FREEZER_COUCHDB_PORT" value="5984"/>
  </php>

  <logging>
    <log type="coverage-html" target="build/coverage" title="Object_Freezer"
         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>

  <filter>
    <whitelist addUncoveredFilesFromWhitelist="true">
      <directory suffix=".php">Object</directory>
       <exclude>
         <file>Object/Freezer/HashGenerator.php</file>
         <file>Object/Freezer/IdGenerator.php</file>
       </exclude>
    </whitelist>
  </filter>
</phpunit>

sb@vmware object-freezer % phpunit             
PHPUnit 3.5.10 by Sebastian Bergmann.

................................................................. 65 / 81 ( 80%)
................

Time: 4 seconds, Memory: 11.50Mb

OK (81 tests, 174 assertions)

Writing code coverage data to XML file, this may take a moment.

Generating code coverage report, this may take a moment.
theOwner

Hi.

The documentation is says
log type="coverage-xml" target="/tmp/coverage.xml"
coverage-xml!
http://www.phpunit.de/manual/3.5/en/appendixes.configuration.html

It is working :)

Sebastian Bergmann

Fixed in the documentation now. Thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.