Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ensure minimal coverage on new Subversion commits

We have a massive project with almost no unit tests at all. I would like to ensure from now on that the developers commit new features (or bugs!) without minimal coverage for corresponding unit tests.

What are some ways to enforce this?

We use many tools, so perhaps I can use a plugin (jira, greenhopper, fisheye, sonar, hudson). I was also thinking perhaps a Subversion pre-commit hook, the Commit Acceptance Plugin for jira, or something equivalent.

Thoughts?

like image 838
Nicolas Rodríguez Seara Avatar asked Mar 02 '11 21:03

Nicolas Rodríguez Seara


People also ask

What is commit coverage?

Having coverage by commit allows to make sure that a specific feature has been tested without drowning in the noise of the entire repo.

What does coverage mean in GitHub?

Coverage means "code coverage": the amount of code covered by the unit-test cases. As seen in this issue, each GitHub project can chose to add as a comment to a PR any additional relevant information (like code coverage for instance).


1 Answers

Sonar (wonderful tool by the way) with Build breaker plugin can break your Hudson build when some metrics don't meet specified rules. You can setup such a rule in Sonar that would trigger an alert (eventually causing the build to fail) when the coverage is below given point. The only drawback is that you probably want the coverage to grow, so you must remember to increase the alert level every day to the current value.

like image 99
Tomasz Nurkiewicz Avatar answered Oct 21 '22 00:10

Tomasz Nurkiewicz