为什么 buildbot 在应该失败的时候却“没有”失败?
我正在尝试修复一个非常复杂的构建机器人基础构建系统,该系统有一个令人讨厌的习惯,即显示带有“失败(1)”的绿色条。
问题是我们使用 ShellCommand 构建步骤运行多个命令,当它返回非零时,整个构建不会失败。
我们还有一些步骤在详细信息页面上显示为红色,但整个构建仍然显示为绿色。
据我所知,我的 master.cfg 中的步骤本身没有设置“flunkOnFailure”,默认值为 true。 (尽管从我找到的手册页中并不完全清楚)
我需要做什么(或撤消)才能确保在 ShellCommand 失败时整个构建失败?
这是在 100% Linux 环境上运行的。
非常感谢。
I'm trying to fix a very complex buildbot base build system, which has the annoying habit of showing green bars with 'failed (1)' in them.
The problem is that we run several commands using the ShellCommand build step, which is not failing the whole build when it returns non zero.
We also have steps which do show up red on the detail page, but the whole build still shows green.
As far as know 'flunkOnFailure' is not set on the steps themselves in my master.cfg, and the default is true. (Although that's not entirely clear from the manual pages I have found)
What do I need to do ( or undo ) to ensure that an entire build fails when a ShellCommand does?
This is running on 100% Linux environment.
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您向工厂添加步骤 (iefaddStep(your_step)) 时,您应该指定haltOnFailure = True,以便在特定构建步骤返回 FAILURE 时使整个构建失败。
When you add step to a factory (i.e. f.addStep(your_step)) you should specify haltOnFailure = True to make whole build fail whenever particular build step returns FAILURE.
BuildStep
中flunkOnFailure
的默认值为False
。各种子类都会覆盖此默认值,特别是 ShellCommand。我猜测红色的特定步骤(构建的最终结果为绿色)没有设置 flunkOnFailure。另一方面,可能是未设置
haltOnFailure
,因此其他步骤正在运行并成功,但构建的总体结果仍然是失败。成功的步骤仍然是绿色的,即使它们遵循失败的步骤。特别是,瀑布页面的主体总体上并不指示特定构建是成功还是失败(尽管顶部的框指示最近构建的结果。网格或最近构建页面将显示结果的构建清晰。The default for
flunkOnFailure
isFalse
inBuildStep
. Various subclasses override this default, in particularShellCommand
. I would guess that the particular steps that are red, with the final result of the build being green, don't haveflunkOnFailure
set.On the other hand, it could be that
haltOnFailure
isn't set, so other steps are running and succeeding, but that the overall result of the build is still failure. The steps that succeed will still be green, even if they follow a failing step. In particular, the body of the waterfall page doesn't indicate whether a particular build succeeded or failed, overall (although the boxes along the top indicate the result of the most recent build. Either the grid or recent-build page will show the results of builds clearly.