From: Ondrej Lichtner <olichtne(a)redhat.com>
Immediately print out a log message when a new Result object is added to
the recipe run log of results. This should give testers more
interactivity with the execution of the recipe by immediatelly seeing
all the results.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Recipe.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lnst/Controller/Recipe.py b/lnst/Controller/Recipe.py
index 68c8c37..42f4e3d 100644
--- a/lnst/Controller/Recipe.py
+++ b/lnst/Controller/Recipe.py
@@ -11,7 +11,9 @@
"""
import copy
+import logging
from lnst.Common.Parameters import Parameters, Param
+from lnst.Common.Colours import decorate_with_preset
from lnst.Controller.Requirements import _Requirements, HostReq
from lnst.Controller.Common import ControllerError
from lnst.Controller.RecipeResults import BaseResult, Result
@@ -156,6 +158,19 @@ def add_result(self, result):
self._results.append(result)
+ result_str = (
+ decorate_with_preset("PASS", "pass")
+ if result.success
+ else decorate_with_preset("FAIL", "fail")
+ )
+ if len(result.description.split("\n")) == 1:
+ logging.info(
+ "Result: {}, What: {}".format(result_str, result.description)
+ )
+ else:
+ logging.info("Result: {}, What:".format(result_str))
+ logging.info("{}".format(result.description))
+
@property
def match(self):
return self._match
--
2.21.0