构建失败的原因
作为一名构建工程师,我不断寻找新的、有趣的方法来改进我们的构建过程 - 其中包括寻找新的、有趣的方法来使我们的构建失败!
我还没有找到构建失败的规范原因列表......所以我认为是时候创建一个了。考虑到这一点:
哪些构建时检查(无论是明显的还是创造性的)您见过失败的构建吗?
As a build engineer, I'm constantly looking for new and interesting ways to improve our build process - and that includes looking for new and interesting ways to fail our builds!
I have yet to find a canonical list of reasons to fail a build ... so I figure it's time to get one created. With that in mind:
What build-time checks - both obvious and creative - have you seen fail builds?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
构建中未经批准的签入。例如签入的代码与工作项或错误修复无关。
Unapproved Checkins in Build. Things like code checked in that is not associated to a work item or a bug fix.
代码未通过自动质量检查(FxCop 等)。
Code failing automated quality inspections (FxCop, etc.).
单元测试失败。
Unit test failure(s).
Martin Fowler 在介绍持续集成的文章中提出了未能运行应用程序的单元测试套件是构建失败的一个令人信服的原因。
In his article introducing Continuous Integration, Martin Fowler presented failure to run the application's suite of unit tests as a compelling reason to fail a build.
编译失败警告
fail on compilation warning
在模块(例如java包)之间引入循环依赖。
Introducing a cyclical dependency between modules (eg java packages).
我的公司实际上并没有这样做,但是对于像我们这样的大型遗留代码库,在未记录的更改上失败会很好。如果没有某种错误票,我们的 QA 部门将不知道测试更改,这太可怕了!
My company doesn't actually do this, but with a large legacy codebase like ours, it would be good to fail on undocumented changes. Without a bug ticket of some kind, our QA department wouldn't know to test the changes, and that is scary!
检查不同 jar 文件 (Java) 中的重复类(相同的包和类名)。
Check for duplicate classes (same package and class name) in different jar files (Java).
代码覆盖率降低或低于可接受的阈值。
Code coverage decreases or falls below an acceptable threshold.
nuff 说,像检查编译失败这样简单的事情应该被视为强制性的。
导致构建损坏的签入应该是不可接受的,尽管可悲的事实是许多组织确实接受这种情况。
如果编译失败:
为什么? 因为构建已损坏。
Something as simple as a check on compilation failure should be considered mandatory, nuff said.
Check-ins that lead to broken builds should be unacceptable, although the sad truth is that many organizations do accept such.
If the compilation fails:
Why? BECAUSE THE BUILD IS BROKEN.