mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-22 16:27:39 +01:00
The E2E docker-compose stack has been modified to include code coverage for all scripts that are kept in /project and are not in the exclusion list. The start command for `deployer` container has been replaced with a `start-e2e-test.sh` script, which will execute E2E tests, generate a Clover report and then return the exit code of E2E test process to make sure that CI is aware of the test result. Whole idea for collecting E2E coverage has been inspired by the [this][1] article. All of scripts in `deployer` container will now start with additional wrapper-like PHP code, which checks if the `PHP_CCOV_START_FILE` variable is present. If not, then nothing happens, but if the variable points to a PHP file, then that file is being included. The `docker-compose.yml` file has `PHP_CCOV_START_FILE` configured to point to a file, which sets up code coverage, that starts counting which instructions in `/project` directory have been called. Once `php` interpreter starts shutting down, the coverage report is being dumped into temporary files. Once all tests have been processed, a script for merging partial coverage reports is executed and finally a Clover code coverage file is stored in the path defined in the `PHP_CCOV_OUTPUT_FILE` env var. [1]: https://tarunlalwani.com/post/php-code-coverage-web-selenium/