![]() It's just a pre-configured PHP environment, so it just runs and terminates immediately. To clarify: I cannot set my interpreter to connect to an existing container (using docker-compose exec) since my container is not a web-server. My PhpStorm configuration (File -> Settings -> Languages & Frameworks -> PHP -> Test Frameworks): Works great, now Share. or for mac: brew uninstall phpunit brew install phpunit. sudo apt-get remove phpunit sudo apt-get install -autoremove. Perhaps the container is stopping before the file has a chance to be generated? Fixed it by uninstalling phpunit from my Ubuntu-system with. However, I'm not sure why it's not being generated in the first place when the tests are run via PHPStorm. If I disconnect from the container, the coverage file will be lost. $ php /app/vendor/phpunit/phpunit/phpunit -dzend_extension=.Īnd sure enough, the generated coverage XML file was there! After that, I checked the /opt/phpstorm-coverage directory. So I copied PHPStorm's "Test with coverage" command, ran bash in the container, pasted the command and executed it. I suspected that it may have something to do with the fact that my interpreter is set to create a new container on every run (i.e. coverage : /opt/ phpstorm - coverageīut after running tests with coverage using PHPStorm, the directory remains empty. i.e php:5.6-apache Its a Laravel application. This container will use a specific version of php. If the coverage file is being generated, I'll be able to see it in this directory. i want to run a specific version of phpUnit WITHIN a docker container. I've tried mapping the directory, as Herberto suggests, to a "coverage" sub-directory in the projects root. It seems like the coverage file is not being generated in /opt/phpstorm-coverage. If you don't already have a laravel.test interpreter in the list, create a new one and configure it as follows: Name: laravel. Select the PHP version you want to write your application in, and click on the '.' button next to the CLI Interpreters drop-down selector. Is there any way to change the location for phpstorm to read coverage files?Įugene Morozov Yes, the -coverge-clover argument is being added correctly. Open PhpStorm's settings and open the PHP section. Resulting in 0% coverage in phpstorm, but the coverage files is actually created in the php container in /opt/phpstorm-coverage/ that is passed in the coverage-clover options. When the command line finish executes successfully, it generates a coverage file, that should be read by phpstorm.īut it seems like, phpstorm can't access the coverage file :php-dev/]:php -dxdebug.remote_port=19000 verage_enable=1 vendor/phpunit/phpunit/phpunit -coverage-clover /opt/phpstorm-coverage/ -configuration /var/project_name/phpunit.xml Tests\Unit\TestFileName /var/project_name/tests/Unit/TestFileName.php -teamcity -cache-result-file=/var/project_name/. It runs the following command to container when i do 'Run TestFileName(PHPUnit) with coverage': ![]() ![]() I've already setup my project to be able to run, test, and debug (xdebug) with phpstorm tools.īut i can't seem to run code coverage with phpstorm. How do you do code coverage with phpstorm?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |