问题描述
我们有一个几乎没有单元测试的大型项目.我想确保从现在开始,开发人员提交新功能(或错误!),而不会对相应的单元测试进行最低限度的覆盖.
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?
我们使用了很多工具,所以也许我可以使用一个插件(jira、greenhopper、fisheye、sonar、hudson).我也在考虑使用 Subversion 预提交钩子、jira 的 Commit Acceptance Plugin 或类似的东西.
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.
想法?
推荐答案
Sonar(顺便说一句,很棒的工具)与 构建破坏者 插件可以在某些指标不符合指定规则时破坏您的 Hudson 构建.您可以在 Sonar 中设置这样一个规则,当覆盖范围低于给定点时会触发警报(最终导致构建失败).唯一的缺点是您可能希望覆盖范围扩大,因此您必须记住每天将警报级别提高到当前值.
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.
这篇关于确保对新 Subversion 提交的覆盖范围最小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!