Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging coverage files generated with codeception #87

Closed
jcheron opened this issue Jan 30, 2019 · 2 comments
Closed

merging coverage files generated with codeception #87

jcheron opened this issue Jan 30, 2019 · 2 comments

Comments

@jcheron
Copy link

jcheron commented Jan 30, 2019

Problem:

I use codeception for acceptance (with Selenium) and local unit tests.
I want to merge remote coverage with local.
The 2 generated reports make references to the same files (identical paths and namespaces), however, codeception does not merge them.

So I'm trying to use phpcov...

I use the --coverage option to produce serialized format files

codecept run --coverage

The 2 generated files are:

  • coverage.serialized in the _output local folder
  • codecoverage.serializedin the _output/c3tmp remote folder on the web server
    I copy the remote file in the same folder (tests/_output) that the local and execute:
./vendor/bin/phpcov merge tests/_output/ --clover tests/_output/coverage-all.xml

Console output:

phpcov 5.0.0 by Sebastian Bergmann.
Generating code coverage report in Clover XML format ... done

No error, but the generated file is empty:

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1548805986">
  <project timestamp="1548805986">
    <metrics files="0" loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
  </project>
</coverage>

phpcov is it compatible with codeception and the serialized format as some say? see Codeception/Codeception#3245 (comment)

configuration

  • phpcov version: 5.0.0
  • Codeception version: 2.5.2
  • PHPUnit: 7.5.2
  • PHP Version: 7.2.13
  • Operating System: Debian ? (Scrutinizer-ci)
  • Installation type: Composer
@ahocquard
Copy link

ahocquard commented Feb 3, 2019

Hello,

I didn't use codeception at all, so maybe my comment is not relevant.
Did you configure a whitelist somewhere?

If there is nothing configured as whitelist, everything will be filtered.
For example, with phpunit, you have to configure a whitelist this way in phpunit.xml:

    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">your_directory/</directory>
        </whitelist>
    </filter>

https://phpunit.readthedocs.io/en/7.4/code-coverage-analysis.html#whitelisting-files

@jcheron
Copy link
Author

jcheron commented Feb 6, 2019

There is also a whitelist with codeception:
in codeception.yml file:

coverage:
    include:
        - directoryToInclude/

but the problem was elsewhere.
I found the solution, see Codeception/Codeception#5368 (comment)

Thank you for your answer

@jcheron jcheron closed this as completed Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants