1
votes

I run Codeception acceptance tests and get results:

enter image description here

As you see coverage is 0%

Then I open coverage results in browser from _output/acceptance.remote.coverage/index.html and see total coverage 81.13%

enter image description here

And the questions is: why coverage result not merged and not printed to console? I have to write unit-tests too for cover all methods?

acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser:
            url: http://127.0.0.1:4444
        - \Helper\Acceptance

codeception.yml

actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
settings:
    bootstrap: _bootstrap.php
    colors: true
    memory_limit: 1024M
coverage:
    enabled: true
    c3_url: http://127.0.0.1:4444
    remote: true
    whitelist:
        include:
            - src/*
        exclude:
            - tests/*
extensions:
    enabled:
        - Codeception\Extension\RunFailed

Run tests command

codecept run --coverage --coverage-xml --coverage-html --coverage-text --fail-fast

Versions

Codeception PHP Testing Framework v2.2.2
Powered by PHPUnit 5.4.6 by Sebastian Bergmann and contributors.
1
im stuck with the same problem, see codeception.com/docs/11-Codecoverage#remote-server - fehrlich

1 Answers

0
votes

Codeception won't merge your results, as stated in the documentation:

But if you run tests on different server [...] a single option remote should be added to config.
[...]
In this case remote Code Coverage results won’t be merged with local ones, if this option is enabled. Merging is possible only in case a remote and local files have the same path. But in case of running tests on a remote server we are not sure of it.

Maybe you can do it manually by using phpcov.