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-28 18:15:29 +0100
commit2acb49212ef8d06cf2a0c84a696f8b4b1b2334c1 (patch)
tree44f17af97a2d4b963fa20aae52213eb0e509d079
parentb7fa39c31a060b42dc4b592299dc9def10a93709 (diff)
downloadpoky-2acb49212ef8d06cf2a0c84a696f8b4b1b2334c1.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. (From OE-Core rev: 866c652c850d9e23300218fcbe0b9e4b3ade2ebf) 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> 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):
182 (status, log) = self._getTestResultDetails(case) 182 (status, log) = self._getTestResultDetails(case)
183 183
184 t = "" 184 t = ""
185 duration = 0
185 if case.id() in self.starttime and case.id() in self.endtime: 186 if case.id() in self.starttime and case.id() in self.endtime:
186 t = " (" + "{0:.2f}".format(self.endtime[case.id()] - self.starttime[case.id()]) + "s)" 187 duration = self.endtime[case.id()] - self.starttime[case.id()]
188 t = " (" + "{0:.2f}".format(duration) + "s)"
187 189
188 if status not in logs: 190 if status not in logs:
189 logs[status] = [] 191 logs[status] = []
@@ -191,6 +193,8 @@ class OETestResult(_TestResult):
191 report = {'status': status} 193 report = {'status': status}
192 if log: 194 if log:
193 report['log'] = log 195 report['log'] = log
196 if duration:
197 report['duration'] = duration
194 if dump_streams and case.id() in self.logged_output: 198 if dump_streams and case.id() in self.logged_output:
195 (stdout, stderr) = self.logged_output[case.id()] 199 (stdout, stderr) = self.logged_output[case.id()]
196 report['stdout'] = stdout 200 report['stdout'] = stdout