[Buildbot-devel] Marking a build step as failed unless the STDOUT contains a magic string.
Benoit Sigoure
tsuna at lrde.epita.fr
Tue Jan 22 16:01:19 UTC 2008
On Jan 22, 2008, at 4:51 PM, Matisse Enzer wrote:
>
> I have two factory steps:
>
> f1.addStep(shell.ShellCommand, command=['make', 'smoke'])
> f1.addStep(shell.ShellCommand, command=['make', 'languages-smoke'])
>
> and I need to mark each step as a failure unless the stdout contains a
> line
> exactly matching:
> ^All tests successful.$
>
> Is there a "best practice" for doing this sort of thing?
I would recommend:
f1.addStep(shell.ShellCommand, command="make smoke | grep --line-
regexp -F 'All tests successful.'")
But this will cut off the entire log, which is probably undesirable.
Possible workaround:
f1.addStep(shell.ShellCommand, command="make smoke >stdout; cat
stdout; grep --line-regexp -F 'All tests successful.'")
If you really want to do it on the BuildBot side, you need to
subclass shell.ShellCommand and override one of its methods (can't
remember which) to properly set the failed state whenever that
particular line didn't appear in the output.
HTH. Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
More information about the devel
mailing list