[users at bb.net] Help with new buildstep.

Hugh Sorby h.sorby at auckland.ac.nz
Mon Feb 19 23:58:25 UTC 2018


Ok, I think I have cracked it I added:


        test_results_parser = LineConsumerLogObserver(self.logConsumer)
        self.addLogObserver('stdio', test_results_parser)

into my __init__ method.  The logConsumer method just scans through the log line by line and looks for information which works fine.

I also added

        rc = cmd.results()
        if rc == results.SUCCESS:
            if self._total is not None and self._failed == 0 and self._total > 0:
                rc = results.SUCCESS
            else:
                rc = results.FAILURE

        defer.returnValue(rc)?

to the bottom of my run method.  This appears to work as expected.

Please let me know if I have made any mistakes.

Thanks.



________________________________
From: users <users-bounces at buildbot.net> on behalf of Hugh Sorby <h.sorby at auckland.ac.nz>
Sent: Tuesday, February 20, 2018 9:27 AM
To: Pierre Tardy
Cc: users at buildbot.net
Subject: [FORGED] Re: [users at bb.net] Help with new buildstep.


?

Ok, I have seen this class but how does it fit into the code?  I can only see examples of using this class with the old-style steps which use the 'start' method.



________________________________
From: Pierre Tardy <tardyp at gmail.com>
Sent: Monday, February 19, 2018 11:26 PM
To: Hugh Sorby
Cc: users at buildbot.net
Subject: Re: [users at bb.net] Help with new buildstep.

Hi,
What you need is a logobserver.
http://docs.buildbot.net/latest/developer/cls-logobserver.html

There is a LineConsumerLogObserver which can be used to read the logs one line by one line.
This component is optimised to manage the data on the flow, and avoid consuming lots of memory by loading the log in memory.

Regards
Pierre

On Mon, Feb 19, 2018 at 3:54 AM Hugh Sorby <h.sorby at auckland.ac.nz<mailto:h.sorby at auckland.ac.nz>> wrote:

Hi All,


I'm trying to update an old buildstep to the 'new-style'.  What I used to do was pass the stdio log line by line looking for a matching string.  Now using the 'run' method I have


    @defer.inlineCallbacks
    def run(self):
        command = self.command

        cmd = yield self.makeRemoteShellCommand(command=command, collectStdout=True, stdioLogName="stdoutLog")

        yield self.runCommand(cmd)

        defer.returnValue(cmd.results())

but I'm unsure of how or when I should parse the log and set the result.  I don't actually think I need to collect stdout but I have left it in here as I was testing out some ideas.

Many thanks for any help or pointers,
Hugh.


_______________________________________________
users mailing list
users at buildbot.net<mailto: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/20180219/ef8de4a3/attachment.html>


More information about the users mailing list