summaryrefslogtreecommitdiffstats
path: root/qtip/reporter
diff options
context:
space:
mode:
authorTaseer <taseer94@gmail.com>2017-03-23 14:26:49 +0500
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-03-24 09:29:04 +0000
commit6a4c4e2dba5c565871aa7259978a6ad547c34be2 (patch)
tree4d777f65e5bbaca237367d0e93a06caf29fb9b8e /qtip/reporter
parentf01644b80a940cf17300114db7593c66c6120b54 (diff)
Integrate cli, runner and reporter.
- Execute runner via a shell command - Change format of qtip result directory to qtip-timestamp - Add path option in reporter to match with runner JIRA: QTIP-229 Change-Id: I7d8562fd7100b1f40cdc8d53b0daa6a06a55b495 Signed-off-by: Taseer Ahmed <taseer94@gmail.com> (cherry picked from commit c2bb13c460566a18e61a3c840bf12f7f717940c2)
Diffstat (limited to 'qtip/reporter')
-rw-r--r--qtip/reporter/console.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/qtip/reporter/console.py b/qtip/reporter/console.py
index 64d677ba..cb51d9c9 100644
--- a/qtip/reporter/console.py
+++ b/qtip/reporter/console.py
@@ -28,19 +28,17 @@ class ConsoleReporter(BaseActor):
tpl_path = path.join(path.dirname(__file__), 'templates')
tpl_loader = FileSystemLoader(tpl_path)
self._env = Environment(loader=tpl_loader)
- self.result_path = path.join(ROOT_DIR, 'collector')
- def load_result(self):
- # TODO (taseer) change result directory format more suitable to filter out
- result_dirs = glob.glob('{}/20*'.format(self.result_path))
+ def load_result(self, result_path):
+ result_dirs = glob.glob('{}/qtip-*'.format(result_path))
# select the last (latest) directory for rendering report, result_dirs[-1]
- with open(path.join(self.result_path, result_dirs[-1], 'result.json')) as sample:
+ with open(path.join(result_path, result_dirs[-1], 'result.json')) as sample:
result = json.load(sample)
return result
- def render(self, metric):
+ def render(self, metric, result_path):
template = self._env.get_template('base.j2')
- var_dict = self.load_result()
+ var_dict = self.load_result(result_path)
var_dict['metric_name'] = metric
out = template.render(var_dict)
return out