testresults.json: add duration of the tests as well
PATCH 1/1 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 <[email protected]>
--- meta/lib/oeqa/core/runner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
meta/lib/oeqa/core/runner.py +5 -1
@@ -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
Signature · 1 line
2.26.1