summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2020-04-30 14:30:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-21 12:09:01 +0100
commit8fc19639f47b959a141dae231395bbababa644e1 (patch)
tree9b3532754bda869eb3336d36a34ffa4c2d1cc745
parent3be441f12c790cefb0e2f7e9c88a920f03787719 (diff)
downloadopenembedded-core-8fc19639f47b959a141dae231395bbababa644e1.tar.gz
openembedded-core-8fc19639f47b959a141dae231395bbababa644e1.tar.bz2
openembedded-core-8fc19639f47b959a141dae231395bbababa644e1.zip
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>
-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