Codeception / Codeception

Full-stack testing PHP framework
http://codeception.com
MIT License
4.77k stars 1.3k forks source link

Can't run Coverage #5989

Closed roomm closed 3 years ago

roomm commented 4 years ago

What are you trying to achieve?

Trying to run this php vendor/bin/codecept run --coverage

What do you get instead?

Codeception PHP Testing Framework v4.1.7
Powered by PHPUnit 9.3.10 by Sebastian Bergmann and contributors.
Running with seed: 

  [Connecting To Db] {"config":{"populate":false,"cleanup":false,"reconnect":false,"waitlock":0,"dump":null,"populator":null,"dsn":"mysql:host=*****;port=*****;dbname=****","user":"*****","password":"****"},"options":[]}
  [Db] Connected to default foodradar_testing

App\Tests.acceptance Tests (13) -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Modules: WebDriver, Db, Symfony, Doctrine2, \App\Tests\Helper\Acceptance, Asserts
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In ErrorHandler.php line 83:

  [PHPUnit\Framework\Exception (2)]                                                                                                     
  file_get_contents(http://localhost//c3/report/clear): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error  

Exception trace:
  at /var/www/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php:83
 Codeception\Subscriber\ErrorHandler->errorHandler() at n/a:n/a
 file_get_contents() at /var/www/vendor/codeception/codeception/src/Codeception/Coverage/Subscriber/LocalServer.php:167
 Codeception\Coverage\Subscriber\LocalServer->c3Request() at /var/www/vendor/codeception/codeception/src/Codeception/Coverage/Subscriber/LocalServer.php:72
 Codeception\Coverage\Subscriber\LocalServer->beforeSuite() at /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php:264
 Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() at /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php:239
 Symfony\Component\EventDispatcher\EventDispatcher->callListeners() at /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php:73
 Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /var/www/vendor/codeception/codeception/src/Codeception/Event/DispatcherWrapper.php:25
 Codeception\SuiteManager->dispatch() at /var/www/vendor/codeception/codeception/src/Codeception/SuiteManager.php:159
 Codeception\SuiteManager->run() at /var/www/vendor/codeception/codeception/src/Codeception/Codecept.php:196
 Codeception\Codecept->runSuite() at /var/www/vendor/codeception/codeception/src/Codeception/Codecept.php:163
 Codeception\Codecept->run() at /var/www/vendor/codeception/codeception/src/Codeception/Command/Run.php:503
 Codeception\Command\Run->runSuites() at /var/www/vendor/codeception/codeception/src/Codeception/Command/Run.php:397
 Codeception\Command\Run->execute() at /var/www/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/vendor/symfony/console/Application.php:1005
 Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/console/Application.php:271
 Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/console/Application.php:147
 Symfony\Component\Console\Application->run() at /var/www/vendor/codeception/codeception/src/Codeception/Application.php:117
 Codeception\Application->run() at /var/www/vendor/codeception/codeception/app.php:46
 {closure}() at /var/www/vendor/codeception/codeception/app.php:47
 require() at /var/www/vendor/codeception/codeception/codecept:7

run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--phpunit-xml [PHPUNIT-XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--bootstrap [BOOTSTRAP]] [--no-redirect] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--coverage-phpunit [COVERAGE-PHPUNIT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--seed SEED] [--no-artifacts] [--] [<suite> [<test>]]

COMMAND DID NOT FINISH PROPERLY.
  [Db] Disconnected from default

In apache logs:

 Uncaught Error: Call to undefined function Codeception\\Lib\\codecept_absolute_path()

Details

codeception/c3                       2.4.2              CodeCoverage collector for Codeception
codeception/codeception              4.1.7              BDD-style testing framework
codeception/lib-asserts              1.13.1             Assertion methods used by Codeception core and Asserts module
codeception/lib-innerbrowser         1.3.2              Parent library for all Codeception framework modules and PhpBrowser
codeception/module-asserts           1.3.0              Codeception module containing various assertions
codeception/module-db                1.0.1              WebDriver module for Codeception
codeception/module-doctrine2         1.0.1              Doctrine2 module for Codeception
codeception/module-phpbrowser        1.0.1              Codeception module for testing web application over HTTP
codeception/module-symfony           1.1.1              Codeception module for Symfony framework
codeception/module-webdriver         1.1.1              WebDriver module for Codeception
codeception/phpunit-wrapper          9.0.4              PHPUnit classes used by Codeception
codeception/stub                     3.7.0              Flexible Stub wrapper for PHPUnit's Mock Builder
composer/package-versions-deprecated 1.11.99            Composer plugin that provides efficient querying for installed package versions (no runtime IO)
doctrine/annotations                 1.10.4             Docblock Annotations Parser
doctrine/cache                       1.10.2             PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
doctrine/collections                 1.6.7              PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common                      3.0.2              PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection suppo...
doctrine/dbal                        2.11.0             Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/doctrine-bundle             2.1.2              Symfony DoctrineBundle
doctrine/doctrine-migrations-bundle  3.0.1              Symfony DoctrineMigrationsBundle
doctrine/event-manager               1.1.1              The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
doctrine/inflector                   1.4.3              PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
doctrine/instantiator                1.3.1              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                       1.2.1              PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations                  3.0.1              PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and...
doctrine/orm                         v2.7.3             Object-Relational-Mapper for PHP
doctrine/persistence                 2.0.0              The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
doctrine/reflection                  1.2.1              The Doctrine Reflection project is a simple library used by the various Doctrine projects which adds some additional functionality on top of the refle...
doctrine/sql-formatter               1.1.1              a PHP SQL highlighting library
egulias/email-validator              2.1.21             A library for validating emails against several RFCs
eightpoints/guzzle-bundle            v8.2.0             Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony 2/3/4. Comes with easy and powerful configuration options and optional plugins.
guzzlehttp/guzzle                    7.0.1              Guzzle is a PHP HTTP client library
guzzlehttp/promises                  v1.3.1             Guzzle promises library
guzzlehttp/psr7                      1.6.1              PSR-7 message implementation that also provides common utility methods
hamcrest/hamcrest-php                v2.0.1             This is the PHP port of Hamcrest Matchers
helmich/mongomock                    v2.4.0             Library containing highly intelligent MongoDB mocks for unit testing
maennchen/zipstream-php              2.1.0              ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.
markbaker/complex                    1.5.0              PHP Class for working with complex numbers
markbaker/matrix                     1.2.1              PHP Class for working with matrices
mockery/mockery                      1.4.2              Mockery is a simple yet flexible PHP mock object framework
mongodb/mongodb                      1.6.1              MongoDB driver library
monolog/monolog                      1.25.5             Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                    1.10.1             Create deep copies (clones) of your objects
myclabs/php-enum                     1.7.6              PHP Enum implementation
nikic/php-parser                     v4.10.0            A PHP parser written in PHP
ocramius/proxy-manager               2.2.3              A library providing utilities to generate, instantiate and generally operate with Object Proxies
phar-io/manifest                     2.0.1              Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                      3.0.2              Library for handling version information and constraints
php-webdriver/webdriver              1.8.2              A PHP client for Selenium WebDriver. Previously facebook/webdriver.
phpdocumentor/reflection-common      2.2.0              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock    5.2.2              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver          1.4.0              A PSR-5 based resolver of Class names, Types and Structural Element Names
phpoffice/phpspreadsheet             1.14.1             PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpspec/prophecy                     1.11.1             Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage            9.1.11             Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator            3.0.4              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                  3.1.0              Invoke callables with a timeout
phpunit/php-text-template            2.0.2              Simple template engine.
phpunit/php-timer                    5.0.1              Utility class for timing
phpunit/phpunit                      9.3.10             The PHP Unit Testing framework.
predis/predis                        v1.1.6             Flexible and feature-complete Redis client for PHP and HHVM
psr/cache                            1.0.1              Common interface for caching libraries
psr/container                        1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/http-client                      1.0.1              Common interface for HTTP clients
psr/http-factory                     1.0.1              Common interfaces for PSR-7 HTTP message factories
psr/http-message                     1.0.1              Common interface for HTTP messages
psr/link                             1.0.0              Common interfaces for HTTP links
psr/log                              1.1.3              Common interface for logging libraries
psr/simple-cache                     1.0.1              Common interfaces for simple caching
ralouphie/getallheaders              3.0.3              A polyfill for getallheaders.
sebastian/cli-parser                 1.0.0              Library for parsing CLI options
sebastian/code-unit                  1.0.5              Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup   2.0.2              Looks up which function or method a line of code belongs to
sebastian/comparator                 4.0.3              Provides the functionality to compare PHP values for equality
sebastian/complexity                 2.0.0              Library for calculating the complexity of PHP code units
sebastian/diff                       4.0.2              Diff implementation
sebastian/environment                5.1.2              Provides functionality to handle HHVM/PHP environments
sebastian/exporter                   4.0.2              Provides the functionality to export PHP variables for visualization
sebastian/global-state               5.0.0              Snapshotting of global state
sebastian/lines-of-code              1.0.0              Library for counting the lines of code in PHP source code
sebastian/object-enumerator          4.0.2              Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector           2.0.2              Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context          4.0.2              Provides functionality to recursively process PHP variables
sebastian/resource-operations        3.0.2              Provides a list of PHP built-in functions that operate on resources
sebastian/type                       2.2.1              Collection of value objects that represent the types of the PHP type system
sebastian/version                    3.0.1              Library that helps with managing the version number of Git-hosted PHP projects
sensio/framework-extra-bundle        v5.6.1             This bundle provides a way to configure your controllers with annotations
snc/redis-bundle                     dev-master 491166f A Redis bundle for Symfony
swiftmailer/swiftmailer              v6.2.3             Swiftmailer, free feature-rich PHP mailer
symfony/asset                        v4.4.13            Symfony Asset Component
symfony/browser-kit                  v4.4.13            Symfony BrowserKit Component
symfony/cache                        v4.4.13            Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts              v2.2.0             Generic abstractions related to caching
symfony/config                       v4.4.13            Symfony Config Component
symfony/console                      v4.4.13            Symfony Console Component
symfony/css-selector                 v4.4.13            Symfony CssSelector Component
symfony/debug                        v4.4.13            Symfony Debug Component
symfony/debug-bundle                 v4.4.13            Symfony DebugBundle
symfony/debug-pack                   v1.0.8             A debug pack for Symfony projects
symfony/dependency-injection         v4.4.13            Symfony DependencyInjection Component
symfony/doctrine-bridge              v4.4.13            Symfony Doctrine Bridge
symfony/dom-crawler                  v4.4.13            Symfony DomCrawler Component
symfony/dotenv                       v4.4.13            Registers environment variables from a .env file
symfony/error-handler                v4.4.13            Symfony ErrorHandler Component
symfony/event-dispatcher             v4.4.13            Symfony EventDispatcher Component
symfony/event-dispatcher-contracts   v1.1.9             Generic abstractions related to dispatching event
symfony/expression-language          v4.4.13            Symfony ExpressionLanguage Component
symfony/filesystem                   v4.4.13            Symfony Filesystem Component
symfony/finder                       v4.4.13            Symfony Finder Component
symfony/flex                         v1.9.4             Composer plugin for Symfony
symfony/form                         v4.4.13            Symfony Form Component
symfony/framework-bundle             v4.4.13            Symfony FrameworkBundle
symfony/http-foundation              v4.4.13            Symfony HttpFoundation Component
symfony/http-kernel                  v4.4.13            Symfony HttpKernel Component
symfony/inflector                    v4.4.13            Symfony Inflector Component
symfony/intl                         v4.4.13            A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/mailer                       v4.4.13            Symfony Mailer Component
symfony/maker-bundle                 v1.21.1            Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/mime                         v4.4.13            A library to manipulate MIME messages
symfony/monolog-bridge               v4.4.13            Symfony Monolog Bridge
symfony/monolog-bundle               v3.5.0             Symfony MonologBundle
symfony/options-resolver             v4.4.13            Symfony OptionsResolver Component
symfony/orm-pack                     v2.0.0             A pack for the Doctrine ORM
symfony/phpunit-bridge               v5.1.5             Symfony PHPUnit Bridge
symfony/polyfill-intl-icu            v1.18.1            Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn            v1.18.1            Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer     v1.18.1            Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring            v1.18.1            Symfony polyfill for the Mbstring extension
symfony/polyfill-php72               v1.18.1            Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73               v1.18.1            Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80               v1.18.1            Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/process                      v4.4.13            Symfony Process Component
symfony/profiler-pack                v1.0.5             A pack for the Symfony web profiler
symfony/property-access              v4.4.13            Symfony PropertyAccess Component
symfony/property-info                v4.4.13            Symfony Property Info Component
symfony/routing                      v4.4.13            Symfony Routing Component
symfony/security-bundle              v4.4.13            Symfony SecurityBundle
symfony/security-core                v4.4.13            Symfony Security Component - Core Library
symfony/security-csrf                v4.4.13            Symfony Security Component - CSRF Library
symfony/security-guard               v4.4.13            Symfony Security Component - Guard
symfony/security-http                v4.4.13            Symfony Security Component - HTTP Integration
symfony/serializer                   v4.4.13            Symfony Serializer Component
symfony/serializer-pack              v1.0.3             A pack for the Symfony serializer
symfony/service-contracts            v2.2.0             Generic abstractions related to writing services
symfony/stopwatch                    v4.4.13            Symfony Stopwatch Component
symfony/swiftmailer-bundle           v3.4.0             Symfony SwiftmailerBundle
symfony/test-pack                    v1.0.6             A pack for functional and end-to-end testing within a Symfony app
symfony/translation                  v4.4.13            Symfony Translation Component
symfony/translation-contracts        v2.2.0             Generic abstractions related to translation
symfony/twig-bridge                  v4.4.13            Symfony Twig Bridge
symfony/twig-bundle                  v4.4.13            Symfony TwigBundle
symfony/validator                    v4.4.13            Symfony Validator Component
symfony/var-dumper                   v4.4.13            Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter                 v4.4.13            A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code
symfony/web-link                     v4.4.13            Symfony WebLink Component
symfony/web-profiler-bundle          v4.4.13            Symfony WebProfilerBundle
symfony/webpack-encore-bundle        v1.7.3             Integration with your Symfony app & Webpack Encore!
symfony/yaml                         v4.4.13            Symfony Yaml Component
symfonycasts/reset-password-bundle   v1.1.1             Symfony bundle that adds password reset functionality.
theseer/tokenizer                    1.2.0              A small library for converting tokenized PHP source code into XML and potentially other formats
twig/twig                            v3.0.5             Twig, the flexible, fast, and secure template language for PHP
webmozart/assert                     1.9.1              Assertions to validate method input/output with nice error messages.
zendframework/zend-code              3.4.1              Extensions to the PHP Reflection API, static code scanning, and code generation
zendframework/zend-eventmanager      3.2.1              Trigger and listen to events within a PHP application
actor: AcceptanceTester
modules:
  enabled:
    - WebDriver:
        # selenium local
        url: 'http://localhost/'
        browser: firefox
        capabilities:
          moz:firefoxOptions:
            args: [ "-headless" ]
        environment: 'test'
    - Db:
        dsn: 'mysql:host=******;port=*****;dbname=*****'
        user: '*****'
        password: '***'
        populate: false
        cleanup: false
    - Symfony:
        app_path: 'src'
        environment: 'test'
        part: ORM
    - Doctrine2:
        depends: Symfony
    - \App\Tests\Helper\Acceptance
    - Asserts

extensions:
  enabled:
    - Codeception\Extension\Recorder:
        ignore_steps: [ executeDbDump, grabEntitiesFromRepository, assert* ]
    - Codeception\Extension\RunProcess:
        - java -Dwebdriver.gecko.driver=/usr/bin/geckodriver -jar /var/www/selenium.jar
namespace: App\Tests
bootstrap: _bootstrap.php
paths:
    tests: tests
    output: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
actor_suffix: Tester
extensions:
    enabled:
        - Codeception\Extension\RunFailed
params:
    - .env.test
coverage:
    enabled: true
    remote: true
    include:
        - src/*
    exclude:
        - src/Command/*
        - src/Domain/Entity/*.php~
Naktibalda commented 4 years ago

Are you running application from the same directory? Is there any chance that it has different version of codeception/codeception installed?

roomm commented 4 years ago

Yes, the application is run from the same directory and only one version (4.1.7) is installed in the project (under vendor folder there's only a version and its 4.1.7)

Naktibalda commented 4 years ago

There must be something unusual about your deployment.

Have you got codecept.phar in /var/www/ by any chance?

Naktibalda commented 4 years ago

If you could get the stack trace of Uncaught Error, it would be very useful too.

roomm commented 4 years ago

Here's the stack trace:

Symfony\Component\ErrorHandler\Error\UndefinedFunctionError:
Attempted to call function "codecept_absolute_path" from namespace "Codeception\Lib".

  at /var/www/vendor/codeception/codeception/src/Codeception/Lib/ParamsLoader.php:25
  at Codeception\Lib\ParamsLoader->load('.env.test')
     (/var/www/vendor/codeception/codeception/src/Codeception/Configuration.php:790)
  at Codeception\Configuration::prepareParams(array('namespace' => 'App\\Tests', 'bootstrap' => '_bootstrap.php', 'paths' => array('tests' => 'tests', 'output' => 'tests/_output', 'data' => 'tests/_data', 'support' => 'tests/_support', 'envs' => 'tests/_envs'), 'actor_suffix' => 'Tester', 'extensions' => array('enabled' => array('Codeception\\Extension\\RunFailed'), 'config' => array(), 'commands' => array()), 'params' => array('.env.test'), 'coverage' => array('enabled' => true, 'include' => array('src/*'), 'exclude' => array('src/Command/*', 'src/Domain/ApiObject/Segment/*', 'src/Domain/ApiObject/Restaurant/Comment.php', 'src/Domain/ApiObject/Restaurant/RestaurantMainTypes.php', 'src/Webapp/Controller/SegmentController.php', 'src/Webapp/EventSubscribers/*', 'src/Domain/Services/SegmentExportService.php', 'src/Domain/Services/SegmentService.php', 'src/Domain/Services/CreateCLISegmentService.php', 'src/Domain/Services/ConceptService.php', 'src/Domain/Services/Session/SessionObservatoryService.php', 'src/Domain/Services/MongoDb/AppCacheMongoService.php', 'src/Domain/Services/MongoDb/SegmentMongoService.php', 'src/Domain/Services/Command/*', 'src/Domain/Services/DataIntegrity/*', 'src/Domain/Services/PerformanceLogService.php', 'src/Domain/Services/RestaurantFilterService.php', 'src/Domain/Document/RestaurantDocument.php', 'src/Domain/Document/SegmentDataDocument.php', 'src/Domain/Entity/*.php~', 'src/Domain/Repository/*')), 'include' => array(), 'extends' => null, 'suites' => array(), 'modules' => array(), 'reporters' => array('xml' => 'Codeception\\PHPUnit\\Log\\JUnit', 'html' => 'Codeception\\PHPUnit\\ResultPrinter\\HTML', 'report' => 'Codeception\\PHPUnit\\ResultPrinter\\Report', 'tap' => 'PHPUnit\\Util\\Log\\TAP', 'json' => 'PHPUnit\\Util\\Log\\JSON', 'phpunit-xml' => 'Codeception\\PHPUnit\\Log\\PhpUnit'), 'groups' => array(), 'settings' => array('colors' => true, 'bootstrap' => false, 'strict_xml' => false, 'lint' => true, 'backup_globals' => true, 'log_incomplete_skipped' => false, 'report_useless_tests' => false, 'disallow_test_output' => false, 'be_strict_about_changes_to_global_state' => false, 'shuffle' => false), 'gherkin' => array()))
     (/var/www/vendor/codeception/codeception/src/Codeception/Configuration.php:181)
  at Codeception\Configuration::config('/var/www/codeception.yml')
     (/var/www/c3.php:106)
  at include('/var/www/c3.php')
     (/var/www/public/index.php:26)

If I add this:

require_once __DIR__ . '/vendor/codeception/codeception/autoload.php';

to the top of the c3.php file and the error chages to:

 file_get_contents(http://localhost//c3/report/clear): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found 
Naktibalda commented 4 years ago

Have you made any modifications to c3.php before getting that stacktrace? Codeception\Configuration::config('/var/www/codeception.yml') shouldn't be further than line 103.

For some reason it bypassed the code which includes autoload.php

dereuromark commented 4 years ago

We have the same or similar issue and fixed it through

diff --git a/src/Codeception/Coverage/Subscriber/LocalServer.php b/src/Codeception/Coverage/Subscriber/LocalServer.php
index 82fc99b3ee..259d655a8b 100644
--- a/src/Codeception/Coverage/Subscriber/LocalServer.php
+++ b/src/Codeception/Coverage/Subscriber/LocalServer.php
@@ -67,18 +67,17 @@ public function beforeSuite(SuiteEvent $e)

         if ($this->settings['remote_config']) {
             $this->addC3AccessHeader(self::COVERAGE_HEADER_CONFIG, $this->settings['remote_config']);
-        }
-
-        $knock = $this->c3Request('clear');
-        if ($knock === false) {
-            throw new RemoteException(
-                '
-                CodeCoverage Error.
-                Check the file "c3.php" is included in your application.
-                We tried to access "/c3/report/clear" but this URI was not accessible.
-                You can review actual error messages in c3tmp dir.
-                '
-            );
+            $knock = $this->c3Request('clear');
+            if ($knock === false) {
+                throw new RemoteException(
+                    '
+                    CodeCoverage Error.
+                    Check the file "c3.php" is included in your application.
+                    We tried to access "/c3/report/clear" but this URI was not accessible.
+                    You can review actual error messages in c3tmp dir.
+                    '
+                );
+            }
         }
     }
roomm commented 4 years ago

Seems that adding the require in C3.php and fixing /src/Codeception/Coverage/Subscriber/LocalServer.php seems to fix the core problem, but seems that there's someting else. Now when I run the tests with coverage:

[Facebook\WebDriver\Exception\UnableToSetCookieException] [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsICookieManager.add]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: chrome://marionette/content/cookie.js :: cookie.add :: line 209"  data: no]
Naktibalda commented 3 years ago

Code Coverage issue was fixed by #5991