tdt / core

Transform any dataset into an HTTP API with The DataTank
http://thedatatank.com
81 stars 31 forks source link

Unit testing: add clover coverage? #342

Open netsensei opened 8 years ago

netsensei commented 8 years ago

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 commented 8 years ago

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

netsensei commented 8 years ago

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
coreation commented 8 years ago

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.