Thanks Roland for the pointer, I ended up with this


@defer.inlineCallbacks

def end_to_end_testing_succeeded(build_step):

    build_id = build_step.build.buildid

    master = build_step.build.master

    build_steps = yield master.data.get(("builds", build_id, 'steps'))

    for step in build_steps:

        if step['name'] == 'Trigger End-to-End Testing':

            return step['results'] == SUCCESS


    return False


And applied it like this:

doStepIf=end_to_end_testing_succeeded,

Seems to work.

________________________________
From: users <[email protected]> on behalf of Roland van Laar 
<[email protected]>
Sent: 14 July 2022 00:36
To: [email protected] <[email protected]>
Subject: Re: [[email protected]] Get previous step build result

Caution - Forged External Domain!
This e-mail cannot be validated and may not have been sent by the sender shown 
in the 'From' field.
If you were not expecting to receive this e-mail we recommend you contact the 
sender to confirm that they sent it.
If you believe this email was legitimately sent, we suggest the sender notify 
their e-mail administrator that it has been received as a forged (fake) e-mail 
by the University of Auckland.
Please contact the Staff Service Centre on extension 86000 if you require 
further assistance.

On 12-07-2022 11:13, Hugh Sorby wrote:
I'm using Buildbot 3.5.0 and I would like to know if the previous step failed 
or succeeded.
I have tried to use the doStepIf method to figure out the previous steps 
status, but I haven't been able to make this work.

Is it possible to do this with 3.5.0?

Hey,

sorry can't give you a dry cut answer. I do have a few pointers for when we 
needed to fetch a previous build.

Have a look at: `getPreviousBuild` from:
https://github.com/buildbot/buildbot/blob/master/master/buildbot/reporters/utils.py<https://github.com/buildbot/buildbot/blob/master/master/buildbot/reporters/utils.py>

Over at scummvm we use a custom reporter which compares the current build to 
the last one on master branch.

Here is our vendorized `getPreviousBuild`:
https://github.com/scummvm/scummvm-sites/blob/director-buildbot/director/vendor/reporter_utils.py<https://github.com/scummvm/scummvm-sites/blob/director-buildbot/director/vendor/reporter_utils.py>

Note: we're on 2.8.4

Regards,

Roland


Many thanks for any suggestions/pointers.



_______________________________________________
users mailing list
[email protected]<mailto:[email protected]>
https://lists.buildbot.net/mailman/listinfo/users<https://lists.buildbot.net/mailman/listinfo/users>

_______________________________________________
users mailing list
[email protected]
https://lists.buildbot.net/mailman/listinfo/users

Reply via email to