Page MenuHomePhabricator

Can we simplify generating and ingesting code coverage reports for developers?
Closed, InvalidPublic


As a developer, it's helpful to be able to run checks on my code before I push it to gerrit. For example, I can run phpcs locally and know that Jenkins is not going to complain that my code doesn't pass PHP code sniffer checks.

In a similar way, I'd like to know about code coverage increase/decrease before I push a commit. The process to do this is manual:

I then need to stash these changes as I work across various directories throughout the day.

A related point is that some IDEs (PhpStorm, for example) allow you to ingest the code coverage reports and will highlight blocks of code that are covered or not covered (docs. However, because we run php tests/phpunit/phpunit.php as the entrypoint instead of vendor/bin/phpunit {some-directory-with-a-phpunit.xml, it doesn't appear to be possible to set up PhpStorm with a Run/Debug configuration (which also includes an option to generate code coverage and apply highlighting to code).

Is there anything we can do to reduce the friction here and make running code coverage, and importing the results, as painless as possible?