From 2daaa0a974278a7720fcc7cbb38a83cbad603dc8 Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Thu, 19 Feb 2015 18:35:21 -0200 Subject: [PATCH] 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: Lucas Meneghel Rodrigues --- avocado/plugins/htmlresult.py | 14 +++++++------- .../resources/htmlresult/templates/report.mustache | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/avocado/plugins/htmlresult.py b/avocado/plugins/htmlresult.py index b48ecdc3..f423a601 100644 --- a/avocado/plugins/htmlresult.py +++ b/avocado/plugins/htmlresult.py @@ -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'])) diff --git a/avocado/plugins/resources/htmlresult/templates/report.mustache b/avocado/plugins/resources/htmlresult/templates/report.mustache index a6c2afd7..e06484f0 100644 --- a/avocado/plugins/resources/htmlresult/templates/report.mustache +++ b/avocado/plugins/resources/htmlresult/templates/report.mustache @@ -68,11 +68,11 @@ {{#tests}} {{time_start}} - {{url}} + {{url}} {{status}} {{time}} {{& fail_reason}} - {{link_basename}} + {{logfile_basename}} {{/tests}} -- GitLab