New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes the issue with paths in groups
section when codeception.yaml
is not in the root of the project
#5674
Fixes the issue with paths in groups
section when codeception.yaml
is not in the root of the project
#5674
Conversation
Also, use `realpath()` to make it possible to correctly use paths to files from the `codeception.yaml` located not in the root of the project. Example: Imagine, custom `codeception.yaml` is located inside `tests/_data` folder. We run codeception as ```bash codecept -g x -c tests/_data/codeception.yaml ``` And we have the following group: ```yaml groups: x: ../../tests/unit/SomeTest.php ``` Such path is resolved to `/path/to/project/tests/_data/../../tests/unit/SomeTest.php` and `GroupManager.php` can not match this path with the real path: ``` /path/to/project/tests/unit/SomeTest.php ``` Applying `realpath()` solves the issue.
To be honest, have no idea how to fix the tests, because when I try to I would appreciate any help / advice here. |
@maks-rafalko try using I think that these tests could be failing because they use made-up file names, so |
… code to handle paths with method names
@Naktibalda I have resolved your comments and tests are green |
Thank you, @maks-rafalko ! |
Thank you both |
groups
section whencodeception.yaml
is not in the root of the projectgroups
key incodeception.yaml
Example:
Imagine, custom
codeception.yaml
is located insidetests/_data
folder.We run codeception as
And we have the following group:
Such path is resolved to
/path/to/project/tests/_data/../../tests/unit/SomeTest.php
and
GroupManager.php
can not match this path with the real path:Codeception/src/Codeception/Lib/GroupManager.php
Lines 116 to 118 in 014faba
Applying
realpath()
solves the issue, because after that paths are the same and the code above successfully matches them.Also, I've added an ability to use absolute paths:
We need it to integrate Codeception with Infection.
Related to infection/infection#45