From: Ondrej Lichtner <olichtne(a)redhat.com>
When the official_result parameter is set to True it indicates that
the result will be filtered by a hash tag. So the save_result method
calculates and adds this tag before submitting the object.
If set to False the hash calculation and the tag is skipped.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Task.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index a5fb0d3..b5080d2 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -921,7 +921,7 @@ class PerfRepoAPI(object):
result = PerfRepoResult(test, name, hash_ignore)
return result
- def save_result(self, result):
+ def save_result(self, result, official_result=False):
if isinstance(result, Noop):
return
elif not self.connected():
@@ -931,9 +931,13 @@ class PerfRepoAPI(object):
logging.debug("PerfRepoResult with no result data, skipping "\
"send to PerfRepo.")
return
+
h = result.generate_hash()
- logging.debug("Adding hash '%s' as tag to result." % h)
- result.add_tag(h)
+ if official_result:
+ logging.debug("Adding hash '%s' as tag to result." %
h)
+ result.add_tag(h)
+ else:
+ logging.debug("Unofficial results - skipping hash tag.")
logging.info("Sending TestExecution to PerfRepo.")
try:
self._rest_api.testExecution_create(result.get_testExecution())
--
2.13.0
Show replies by date