Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Using environment does not work with code coverage #2634
I am trying to run codecoverage for my project with codeception. Here is my build/codeception.yml file:
actor: Tester paths: tests: ../tests log: ../tests/_output data: ../tests/_data helpers: ../tests/_support settings: bootstrap: _bootstrap.php colors: false memory_limit: 2048M coverage: enabled: true remote: false remote_context_options: http: timeout: 60 ssl: verify_peer: false blacklist: include: - ../db/* - ../data/* - ../config/* modules: config: Db: dsn: '' user: '' password: '' dump: tests/_data/dump.sql
I have defined the following environments in tests/acceptance.yml:
class_name: AcceptanceTester modules: enabled: [WebDriver, AcceptanceHelper] config: WebDriver: url: 'http://localhost/project/' browser: firefox env: ci: modules: config: WebDriver: url: 'https://server1.example.com/project/' host: server1.example.com browser: firefox window_size: 1920x1080 ci-mbv: modules: config: WebDriver: url: 'https://server1.example.com/project-mbv/' host: server1.example.com browser: firefox window_size: 1920x1080
When I run the following command:
I will get the error:
The tests are created in subfolders under tests folder (acceptance/, unit/ and api/). Why does the codeception add the environment to end of the test folder? How can I prevent that or am I doing something wrong? This does not work even with remote option set as true - the error in that case is "Suite acceptance-ci-mbv was not loaded".
Here is the codeception exception backtrace:
Thanks for help!
Seems like there is some magic handling of the environment name in SuiteManager.php:136:
$suite->setBaseName($this->env ? substr($name, 0, strpos($name, '-' . $this->env)) : $name);
After changing the environment name to be "cimbv" instead "ci-mbv" something at least happened in the running of the test but still got error:
Seems like the acceptance cookie does not have CodeCoverage_Suite set correctly:
Any idea why this would occur? If I set code coverage disabled, the acceptance tests run ok.