python-provy / provy

provy is a provisioning system in python.

Home Page:http://docs.provy.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Increase code coverage

diogobaeder opened this issue · comments

We have to increase the production code coverage with more tests, in order to strengthen it when we need to change it.

My idea is that we increase to at least 75% coverage - as of this writing, we have 57% -. I'm focusing on that, because this will also help other contributers to participate to the project more easily.

Now we have about 72% coverage, which seems to be a good number, but is not because it doesn't count modules that are not touched by any tests - for example, the provy.more.centos packages and modules -. To test centos, though, I think we need to first have the refactoring to be able to extract common behaviour, otherwise it will be a true nightmare to test it (mostly copy and paste from debian tests, which is very error-prone and I want to avoid as much as possible).

So, for now, my target is to have at least 75% for the currently covered modules, but have at least a decent coverage for each module (some are around 25%, yet). I'm doing this bit by bit, to avoid getting out of the rails from implementing new features and fixing bugs.

Note to the team: right now we have no coverage of any CentOS feature. As soon as the first unit test for anything "provy.more.centos"-related lands, our coverage report will roll down the stairs (because the imports will drill down that package, therefore coverage.py will start reporting the internals of the modules as lines not covered).

I'm not sure how we should deal with this, for now, but I can commit to increasing the coverage for it in the future - not sure how long it will take, but surely a lot.

Done. 100% coverage. We still need end-to-end tests though.