<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 10, 2017 at 11:16 AM Cleber Rosa <<a href="mailto:crosa@redhat.com">crosa@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
<br class="gmail_msg">
On 02/10/2017 05:01 AM, Andrei Stepanov wrote:<br class="gmail_msg">
> Hi.<br class="gmail_msg">
><br class="gmail_msg">
> We need a reliable mechanism to notify Beaker server about start+result<br class="gmail_msg">
> of a avocado-vt test. As you know, avocado-vt test is one of the many<br class="gmail_msg">
> tests produced from cartesian config. We need to notify Beaker about<br class="gmail_msg">
> start+results of _each_ test.<br class="gmail_msg">
><br class="gmail_msg">
> Currently we use: pre_command / post_command<br class="gmail_msg">
><br class="gmail_msg">
> I discovered yesterday, that this commands are not called for FAILED<br class="gmail_msg">
> tests. Especially those have a error in syntax.<br class="gmail_msg">
><br class="gmail_msg">
> In IRC Lukáš Doktor suggested to:<br class="gmail_msg">
><br class="gmail_msg">
> 19:22<ldoktor>astepano: Hello Andrei, the `post_command` is part of the<br class="gmail_msg">
> `env_process` during the postprocess which means it's one of the cleanup<br class="gmail_msg">
> steps the problem is when the postprocess fails before getting to<br class="gmail_msg">
> `post_command` it will not be executed. It all depends on many factors.<br class="gmail_msg">
> Anyway I don't know what all information do you need to produce your<br class="gmail_msg">
> results but I'd strongly recommend writing either `JobPostTests` plugin,<br class="gmail_msg">
> or if you need per-test granularity t<br class="gmail_msg">
> 19:23<ldoktor>Also writing such plugin is really simple and there are<br class="gmail_msg">
> examples in our sources...<br class="gmail_msg">
><br class="gmail_msg">
> So, I want to bring our conversation to this mail listing.<br class="gmail_msg">
><br class="gmail_msg">
> I am not sure that such plugin will do job for avocado-vt tests.<br class="gmail_msg">
> Avacodo-vt tests generated from cartesian configs.<br class="gmail_msg">
><br class="gmail_msg">
> Could you please suggest me the right approach to coupe with this issue?<br class="gmail_msg">
><br class="gmail_msg">
> I need mechanism to call external program before & after _each_<br class="gmail_msg">
> avocado-vt test. The program's environment should have variables:<br class="gmail_msg">
> TESTNAME / TESTRESULT.<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
Andrei,<br class="gmail_msg">
<br class="gmail_msg">
As a *very* brief answer, I'd say this looks like something that can be<br class="gmail_msg">
implemented as a `ResultEvents` plugin:<br class="gmail_msg">
<br class="gmail_msg">
 *<br class="gmail_msg">
<a href="http://avocado-framework.readthedocs.io/en/45.0/ResultFormats.html#implementing-other-result-formats" rel="noreferrer" class="gmail_msg" target="_blank">http://avocado-framework.readthedocs.io/en/45.0/ResultFormats.html#implementing-other-result-formats</a><br class="gmail_msg">
 *<br class="gmail_msg">
<a href="http://avocado-framework.readthedocs.io/en/45.0/api/core/avocado.core.html#avocado.core.plugin_interfaces.ResultEvents" rel="noreferrer" class="gmail_msg" target="_blank">http://avocado-framework.readthedocs.io/en/45.0/api/core/avocado.core.html#avocado.core.plugin_interfaces.ResultEvents</a><br class="gmail_msg">
<br class="gmail_msg">
You would write methods such as "start_test" and "end_test" to send the<br class="gmail_msg">
needed info to Beaker.<br class="gmail_msg">
<br class="gmail_msg">
This would be a feature generic to all Avocado supported tests<br class="gmail_msg">
(including Avocado-VT tests).<br class="gmail_msg"></blockquote><div><br></div><div>Nice. with a ResultEvents beaker plugin, any avocado test would be able to report results to a beaker server, and plugin configuration can be done using standard config file sections. +1.</div></div></div>