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
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Problem resolving paths with codeception.yml inside test root directory #4432
When codeception.yml is inside the test root directory, there is a problem with resolving paths to test files.
I have my folder structure set up like this:
And in codeception.yml I have the path set up like this:
paths: tests: .
Next, I am trying to run the following command:
/tests$ codecept unit/ExampleTest.php
But this results in the following error:
If I prepend
/tests$ codecept ./unit/ExampleTest.php
/tests$ codecept run unit/ExampleTest.php -vvv Codeception PHP Testing Framework v2.3.4 Powered by PHPUnit 5.7.21 by Sebastian Bergmann and contributors. [RuntimeException] Suite 'unit/ExampleTest.php' could not be found Exception trace: () at .....\vendor\codeception\codeception\src\Codeception\Command\Run.php:356 Codeception\Command\Run->execute() at ....\vendor\symfony\console\Command\Command.php:266 Symfony\Component\Console\Command\Command->run() at ....\vendor\symfony\console\Application.php:861 Symfony\Component\Console\Application->doRunCommand() at ....\vendor\symfony\console\Application.php:208 Symfony\Component\Console\Application->doRun() at ....\vendor\symfony\console\Application.php:127 Symfony\Component\Console\Application->run() at ....\vendor\codeception\codeception\src\Codeception\Application.php:103 Codeception\Application->run() at ....\vendor\codeception\codeception\codecept:36
paths: tests: . output: _output data: _data support: _support settings: bootstrap: _bootstrap.php ...
The problem should probably be fixed around here: https://github.com/Codeception/Codeception/blob/2.3/src/Codeception/Command/Run.php#L327
Apply a workaround to fix Codeception#4432. This allows having codeception.yml inside the tests directory by setting `paths`: `tests: .` Fixing this issue properly requires a lot more work. The current CodeCeption implementation uses only basic string matching and does not expect "empty" tests path in multiple places. See for example Run->matchTestFromFilename() and Configuration::isEmpty()
* Fixes #4432 Apply a workaround to fix #4432. This allows having codeception.yml inside the tests directory by setting `paths`: `tests: .` Fixing this issue properly requires a lot more work. The current CodeCeption implementation uses only basic string matching and does not expect "empty" tests path in multiple places. See for example Run->matchTestFromFilename() and Configuration::isEmpty() * Add unit test