avocado.plugins.htmlresult: Use easier to understand template dict keys

Looking in retrospect, we used quite cryptic names for
the logfile and logdir template dict keys. Let's fix that
so that the code is more understandable.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 0de1c6c6
......@@ -111,13 +111,13 @@ class ReportModel(object):
"INTERRUPTED": "danger"}
test_info = self.json['tests']
for t in test_info:
t['link'] = os.path.join(self._results_dir(
relative_links=self.relative_links),
'test-results', t['url'], 'debug.log')
t['link_basename'] = os.path.basename(t['link'])
t['dir_link'] = os.path.join(self._results_dir(
relative_links=self.relative_links),
'test-results', t['url'])
t['logdir'] = os.path.join(self._results_dir(
relative_links=self.relative_links),
'test-results', t['url'])
t['logfile'] = os.path.join(self._results_dir(
relative_links=self.relative_links),
'test-results', t['url'], 'debug.log')
t['logfile_basename'] = os.path.basename(t['logfile'])
t['time'] = "%.2f" % t['time']
t['time_start'] = time.strftime("%Y-%m-%d %H:%M:%S",
time.localtime(t['time_start']))
......
......@@ -68,11 +68,11 @@
{{#tests}}
<tr class="{{row_class}}">
<td>{{time_start}}</td>
<td><a href="{{dir_link}}">{{url}}</a></td>
<td><a href="{{logdir}}">{{url}}</a></td>
<td>{{status}}</td>
<td>{{time}}</td>
<td>{{& fail_reason}}</td>
<td><a href="{{link}}">{{link_basename}}</a></td>
<td><a href="{{logfile}}">{{logfile_basename}}</a></td>
</tr>
{{/tests}}
</table>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册