summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2020-04-30 14:30:33 +0200
committerSteve Sakoman <steve@sakoman.com>2020-05-22 06:34:00 -1000
commit866c652c850d9e23300218fcbe0b9e4b3ade2ebf (patch)
treee1adaf4fc36530c0ae15d114e69d2a78b7d1cafd /meta/lib/oeqa/core
parentae404ef230882e442e9390b314e1ce023fdbbd1b (diff)
downloadopenembedded-core-contrib-866c652c850d9e23300218fcbe0b9e4b3ade2ebf.tar.gz
testresults.json: add duration of the tests as well
This is printed by testimage, but isn't actually saved. It's a useful metric for tracking execution times. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8fc19639f47b959a141dae231395bbababa644e1) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib/oeqa/core')
-rw-r--r--meta/lib/oeqa/core/runner.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index 1284295c34..00b7d0bb12 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -182,8 +182,10 @@ class OETestResult(_TestResult):
(status, log) = self._getTestResultDetails(case)
t = ""
+ duration = 0
if case.id() in self.starttime and case.id() in self.endtime:
- t = " (" + "{0:.2f}".format(self.endtime[case.id()] - self.starttime[case.id()]) + "s)"
+ duration = self.endtime[case.id()] - self.starttime[case.id()]
+ t = " (" + "{0:.2f}".format(duration) + "s)"
if status not in logs:
logs[status] = []
@@ -191,6 +193,8 @@ class OETestResult(_TestResult):
report = {'status': status}
if log:
report['log'] = log
+ if duration:
+ report['duration'] = duration
if dump_streams and case.id() in self.logged_output:
(stdout, stderr) = self.logged_output[case.id()]
report['stdout'] = stdout