Chris Huang-Leaver
Chris Huang-Leaver

Reputation: 6089

Why is buildbot *NOT* failing when it should?

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.

Upvotes: 2

Views: 544

Answers (2)

Tom Prince
Tom Prince

Reputation: 682

The default for flunkOnFailure is False in BuildStep. Various subclasses override this default, in particular ShellCommand. I would guess that the particular steps that are red, with the final result of the build being green, don't have flunkOnFailure 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.

Upvotes: 2

ILYA Khlopotov
ILYA Khlopotov

Reputation: 725

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.

Upvotes: 5

Related Questions