mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
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. (From OE-Core rev: 8fc19639f47b959a141dae231395bbababa644e1) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1db1ef6721
commit
03bb031125
@@ -182,8 +182,10 @@ class OETestResult(_TestResult):
|
|||||||
(status, log) = self._getTestResultDetails(case)
|
(status, log) = self._getTestResultDetails(case)
|
||||||
|
|
||||||
t = ""
|
t = ""
|
||||||
|
duration = 0
|
||||||
if case.id() in self.starttime and case.id() in self.endtime:
|
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:
|
if status not in logs:
|
||||||
logs[status] = []
|
logs[status] = []
|
||||||
@@ -191,6 +193,8 @@ class OETestResult(_TestResult):
|
|||||||
report = {'status': status}
|
report = {'status': status}
|
||||||
if log:
|
if log:
|
||||||
report['log'] = log
|
report['log'] = log
|
||||||
|
if duration:
|
||||||
|
report['duration'] = duration
|
||||||
if dump_streams and case.id() in self.logged_output:
|
if dump_streams and case.id() in self.logged_output:
|
||||||
(stdout, stderr) = self.logged_output[case.id()]
|
(stdout, stderr) = self.logged_output[case.id()]
|
||||||
report['stdout'] = stdout
|
report['stdout'] = stdout
|
||||||
|
|||||||
Reference in New Issue
Block a user