Codeception: Unable to run functional or acceptance tests with --coverage

When I tried run functional test I got an error: dmitry@dmitry:/var/www/lsp.local/httpdocs/protected$ codecept run functional AgencyCest.php --coverage Codeception PHP Testing Framework v1.6.6 Powered by PHPUnit 3.7.24 by Sebastian Bergmann.

Suite functional started

[ErrorException]
file_get_contents(http://lsp.local/index.php/c3/report/clear): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found

run [-c|–config=“…”] [–report] [–html] [–xml] [–tap] [–json] [–colors] [–no-colors] [–silent] [–steps] [-d|–debug] [–coverage] [–no-exit] [–defer-flush] [-g|–group=“…”] [-s|–skip=“…”] [–skip-group=“…”] [suite] [test]

In the older versions of Codeception this error was not occur. For example: dmitry@dmitry:/var/www/lsp.local/httpdocs/protected$ codecept run functional AgencyCest.php --coverage Codeception PHP Testing Framework v1.6.4.2 Powered by PHPUnit 3.7.22 by Sebastian Bergmann.

Suite functional started Trying to create agency (AgencyCest.createAgency) Scenario:

  • As a Admin
  • I am on page “/” …

I used Yii1, my codeception.yml is:

coverage:
    enabled: true
    include:
      - components/*.php
      - controllers/*.php
      - models/*.php
      - modules/*.php
      - extensions/DarwinApps/*.php
    exclude:
        - runtime/*
        - models/Pdf.php
        - models/Rtf.php
        - models/cfb.php
        - components/behaviors/WithRelatedBehavior.php
        - yiic
        - yiic.bat
        - yiic.php
paths:
    tests: tests/codeception
    log: tests/codeception/_log
    data: tests/codeception/_data
    helpers: tests/codeception/_helpers
    groups: tests/codeception/_groups
settings:
    bootstrap: _bootstrap.php
    suite_class: \PHPUnit_Framework_TestSuite
    colors: true
    memory_limit: 1024M
    log: true

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 32 (16 by maintainers)

Most upvoted comments

@nateritter I cant get this working, I setup the Laravel route, require the file, it runs but reports 0 in everything:

actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    helpers: tests/_support
settings:
    bootstrap: _bootstrap.php
    colors: true
    memory_limit: 1024M
coverage:
    enabled: true
    remote: true
    include:
        - app/*
    exclude:
        - app/controllers/BaseController.php
        - app/views/*
        - app/storage/*
        - app/start/*
        - app/lang/*
        - app/database/*
        - app/config/*
modules:
    config:
        Db:
            dsn: ''
            user: ''
            password: ''
            dump: tests/_data/dump.sql
Route::get('/c3/{extra}', function () {
    require base_path('c3.php');
})->where('extra', '.*');

Obviously I have tests

screen shot 2015-05-05 at 00 20 51

Report

screen shot 2015-05-05 at 00 21 52

I am running the coverage tests inside a Vagrant VM with Laravel 4.1 CentOS 6.2 PHP 5.4

Executing vendor/bin/codecept run functional --coverage --coverage-html