<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span class="elementToProof" style="font-size:12pt;margin:0px">Thanks Roland for the pointer, I ended up with this</span>
<div class="elementToProof" style="font-size:12pt;margin:0px"><br>
</div>
<div class="elementToProof" style="font-size:12pt;margin:0px">
<p class="p1" style="margin:0px;font:11px Menlo;min-height:13px"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"></span><br>
</p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px">@defer.inlineCallbacks</span></p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px">def end_to_end_testing_succeeded(build_step):</span></p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"><span class="Apple-converted-space" style="margin:0px">   <span> </span></span>build_id = build_step.build.buildid</span></p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"><span class="Apple-converted-space" style="margin:0px">   <span> </span></span>master = build_step.build.master</span></p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"><span class="Apple-converted-space" style="margin:0px">   <span> </span></span>build_steps = yield master.data.get(("builds", build_id,
 'steps'))</span></p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"><span class="Apple-converted-space" style="margin:0px">   <span> </span></span>for step in build_steps:</span></p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"><span class="Apple-converted-space" style="margin:0px">       <span> </span></span>if step['name'] == 'Trigger End-to-End Testing':</span></p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"><span class="Apple-converted-space" style="margin:0px">           <span> </span></span>return step['results'] == SUCCESS</span></p>
<p class="p1" style="margin:0px;font:11px Menlo;min-height:13px"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"></span><br>
</p>
<p class="p2" style="margin:0px;font:11px Menlo"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"><span class="Apple-converted-space" style="margin:0px">   <span> </span></span>return False</span></p>
<p class="p1" style="margin:0px;font:11px Menlo;min-height:13px"><span class="s1" style="font-variant-ligatures:no-common-ligatures;margin:0px"></span><br>
</p>
<br>
</div>
<div class="elementToProof" style="font-size:12pt;margin:0px">And applied it like this:</div>
<div class="elementToProof" style="font-size:12pt;margin:0px"><br>
</div>
<div class="elementToProof" style="font-size:12pt;margin:0px">doStepIf=end_to_end_testing_succeeded,</div>
<div class="elementToProof" style="font-size:12pt;margin:0px"><br>
</div>
<div class="elementToProof" style="font-size:12pt;margin:0px">Seems to work.</div>
<span class="elementToProof" style="font-size:12pt;margin:0px"></span><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> users <users-bounces@buildbot.net> on behalf of Roland van Laar <roland@micite.net><br>
<b>Sent:</b> 14 July 2022 00:36<br>
<b>To:</b> users@buildbot.net <users@buildbot.net><br>
<b>Subject:</b> Re: [users@bb.net] Get previous step build result</font>
<div> </div>
</div>
<div><span style="color:#ff0000">Caution - Forged External Domain!<br>
This e-mail cannot be validated and may not have been sent by the sender shown in the 'From' field.
<br>
If you were not expecting to receive this e-mail we recommend you contact the sender to confirm that they sent it.
<br>
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.<br>
Please contact the Staff Service Centre on extension 86000 if you require further assistance.</span>
<br>
<br>
On 12-07-2022 11:13, Hugh Sorby wrote:<br>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I'm using Buildbot 3.5.0 and I would like to know if the previous step failed or succeeded.</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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.</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Is it possible to do this with 3.5.0?</div>
</blockquote>
<br>
Hey, <br>
<br>
sorry can't give you a dry cut answer. I do have a few pointers for when we needed to fetch a previous build.<br>
<br>
Have a look at: `getPreviousBuild` from:<br>
<a class="x_moz-txt-link-freetext" href="https://github.com/buildbot/buildbot/blob/master/master/buildbot/reporters/utils.py">https://github.com/buildbot/buildbot/blob/master/master/buildbot/reporters/utils.py</a><br>
<br>
Over at scummvm we use a custom reporter which compares the current build to the last one on master branch.<br>
<br>
Here is our vendorized `getPreviousBuild`:<br>
<a class="x_moz-txt-link-freetext" href="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</a><br>
<br>
Note: we're on 2.8.4<br>
<br>
Regards,<br>
<br>
Roland<br>
<br>
<br>
<blockquote type="cite">
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Many thanks for any suggestions/pointers.</div>
<br>
<fieldset class="x_moz-mime-attachment-header"></fieldset>
<pre class="x_moz-quote-pre">_______________________________________________
users mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:users@buildbot.net">users@buildbot.net</a>
<a class="x_moz-txt-link-freetext" href="https://lists.buildbot.net/mailman/listinfo/users">https://lists.buildbot.net/mailman/listinfo/users</a></pre>
</blockquote>
<br>
</div>
</body>
</html>