Codeception remote - Test framework quit unexpectedly
Hi, trying to get Codeception via remote to work.
I am using a remote CLI Interpretor (it shows the PHP version in the CLI screen etc, so this seems to work).
Then I configured under Testing Framwork a new entry by choosing "Codeception by Remote Interpretor".
I am choosing the CLI from above, path mappings are good and path to Codecept exec is also fine (it shows Codecepton Version 4.1.17, so access is fine).
If I then right click on a functional test and select "Run HomeCest.php (Codeception)" then a terminal windown in the bottom opens.
It shows this in the terminal:
[sshConfig://domainxxx]:/usr/bin/php /home/userXXX/.phpstorm_helpers/codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-interaction frontend/tests/functional/Home/HomeCest.php
Testing started at 15:32 ...
Codeception PHP Testing Framework v4.1.17
Powered by PHPUnit 8.5.14 by Sebastian Bergmann and contributors.
HomeCest: Check login......................................................Ok
HomeCest: Check login wrong................................................Ok
Process finished with exit code 1
In the left sidebar of the test panel, it says: Test framwork quit unexpectedly.
Fun part is also that even that it says above to one of the tests "... OK", I know that this test should fail (by design).
It does successfully fail if I run the codeception direclty on the server via terminal. So it looks like it does not run the test.
Any ideas?
请先登录再写评论。
Sorry, missed this thread completely.
Is it still actual? If it is, would it be possible to share the project?
Just in case, I have checked YouTrack for any relatively recent Codeception-related reports but there is nothing similar at all.
Hi,
thanks for your response.
The problem is still there but I found a workaround:
It seems like PhpStorm does not find the default codeception.yml file in the root of my project (or in the root of the current test folder).
If I manually enter it in the "Run/Debug Configurations" for that test, and select "use alternative configuration file" and point to the file, then it works.
But this has some nasty side effects: If I right click on any test and chose run, it will first fail until I then edit the config for that test and manually point to the codeception.yml.
PS: I am using Yii2 with the advanced template, which ships will codeception files and folders out-of-the box. So I do not have the codeception files at strange locations or so.
@ChristianB
You can specify defaults for your Run/Debug Configurations. Just expand that node, find the entry for the required type and enter the defaults there.
That does not seem to work as I am using backend and frontend sub-folders, where one codeception.yml is in the root.
That one is configured to cascade through the sub-folders where each one has its own codeception.yml. To only run a test which is stored in the frontend, I need to point to the codeception inside the frontend, not the global one.
Or am I mistaken?
Defaults are per project and not per folder.
So yes, if you need different settings in different folders then the aforementioned suggestion with using defaults will not help here.
One additional observation: as mentioned above, I am using a remote CLI. In preferences/php/test i can configure the default runner which is on the remote server.
But in the dialog "Run/Debug Configurations" where I can adjust the "use alternative configuration file" it only allows me to chose from local files, not the remote ones. Is this by design?
And next to that, if it is by design, then why storing full absolute paths there? This way I can not share my test configs with others. Or can I use a project-root var inside that field to make it more relative?
Basically, it only looks absolute from the UI perspective whereas, in fact, the path is actually stored with the $project_dir$ variable. For example, if you have the configuration file saved in the project root, the actual "physical" setting will be stored as
You may check it in the ".idea/workspace.xml" file