[users at bb.net] Post processing stdio or stderr logs

Cipi Bad cipibad at gmail.com
Sun Dec 8 18:50:26 UTC 2019


Hi,

Bellow some old example code I used to parse output for failing tests, I
hope will be easy to adapt in your case:

class MyShellCommand(shell.ShellCommand):

    def __init__(self, **kwargs):
        shell.ShellCommand.__init__(self, **kwargs)
        self.addLogObserver('stdio',
logobserver.LineConsumerLogObserver(self.logConsumer))
        self.testFailed = False

    def logConsumer(self):
        while True:
            stream, line = yield
            if line.find('TEST_FAILURE_INDICATOR') != -1:
                self.testFailed = True

                return

    def evaluateCommand(self, cmd):
        res = shell.ShellCommand.evaluateCommand(self, cmd)
        if self.testFailed:
            res = FAIL

BR,

C


On Sat, Dec 7, 2019 at 10:19 PM honas grael <honasgraeymael at gmail.com>
wrote:

> Hello
> I have a buildstep as follows
>
> makepackages = steps.ShellCommand(name="make packages",
>                                   command=["make", "packages"],
>                                   haltOnFailure=True,
>                                   description="make packages")
>
>
> when it runs the output is sent to stdio, I would like to
>
> add a post processing step following the command that processes
>
> the stdio output from makepackages, so that I can search for
>
> keywords in stdio.
>
> How can I do this? I've read the docs but I do not follow,
>
> can anyone guide me
>
>
> Regards
>
> _______________________________________________
> users mailing list
> users at buildbot.net
> https://lists.buildbot.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20191208/8cae3b51/attachment.html>


More information about the users mailing list