diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2020-04-30 14:30:33 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-21 12:35:39 +0100 |
commit | 03bb03112566bbb3d0b46aad911c3c01b404845e (patch) | |
tree | 2581029db512967d3ddbf0e1753e09390a5e0394 /meta/lib/oeqa | |
parent | 1db1ef6721d0da4501e82fd31923f9216144d386 (diff) | |
download | poky-03bb03112566bbb3d0b46aad911c3c01b404845e.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: 8fc19639f47b959a141dae231395bbababa644e1)
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/core/runner.py | 6 |
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 |