core icon indicating copy to clipboard operation
core copied to clipboard

Unit testing: add clover coverage?

Open netsensei opened this issue 9 years ago • 3 comments

Clover coverage is supported by PHPUnit. I use it an several other projects. It reports how well unit tests are covering the actual code. It helps tremendously to write tests more efficiently because you can see what parts of the code are tested and which aren't.

Clover coverage also integrates nicely with Jenkins and I've noticed that it also shows up in the build logs in Travis.

netsensei avatar Oct 03 '15 17:10 netsensei

Requirements: you will need xdebug enabled for php-cli.

netsensei avatar Oct 03 '15 17:10 netsensei

Just ran phpunit with clover coverage: report attached.

I did notice that running phpunit includes running all tests: including tests provided by Laravel and all dependent vendor packages. With clover coverage on, it took over 10 minutes to run all the tests. So we probably want to figure out how to reduce this so that only app specific code is tested.

screen shot 2015-10-03 at 19 24 00

netsensei avatar Oct 03 '15 17:10 netsensei

Hey @netsensei thanks for the elaborate report, to be honest we know our tests aren't 100% sufficient, we only provided tests for our most important functionalities. Will look into it and see if the clover coverage marks any important functionalities.

coreation avatar Oct 12 '15 08:10 coreation