How do I remove orphans containers before each test?

Testing started at 11:34 AM ...
"[docker-compose://[C:\dev\drm-docker\docker-compose.yml, C:\dev\docker\drm-v2\docker-compose.yml]:drm-v2/]:php" /opt/.phpstorm_helpers/codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-interaction -c /var/www/codeception.yml tests/api/src/Controller/Actions/Cases/ResetCaseCest.php
Found orphan containers (processor-api, rule-supervisor, case) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Starting drm-mysql ...
Starting drm-mysql ... doneCodeception PHP Testing Framework v3.1.1
Powered by PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
Running with seed:

Testing api

I have recently started using phpStorm for testing and I notice the following message appearing all the time:

Found orphan containers (processor-api, rule-supervisor, case) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.

I know about such flag from the CLI but wonder how I can achieve such tasks from within the IDE if it is possible as per today. Any ideas?

0
4 comments

Check out the doc: https://www.jetbrains.com/help/idea/docker.html.
It tells how to add command line flags in run Configurations.

 
0

@Liu docs are not clear to me and I am not running the container from within any configuration, having Codeception setup as remote does start the container automatically once a test is about to run. See my config for the interpreter:

0

Unfortunately, there's no way to do that from the IDE: https://youtrack.jetbrains.com/issue/WI-45050
Maybe it makes sense to switch to using `exec` instead? If your containers are not run and stopped on every test run, there will be fewer orphane containers.
This would only work of course if the service can run continuously.

1

Eugene Morozov thank you for your answer, I could use `exec` instead to avoid that message from appearing not an issue and let's hope this get integrated with the other option too.

0

Please sign in to leave a comment.