diff options
author | Taseer <taseer94@gmail.com> | 2017-03-23 14:26:49 +0500 |
---|---|---|
committer | Taseer <taseer94@gmail.com> | 2017-03-23 19:06:53 +0500 |
commit | c2bb13c460566a18e61a3c840bf12f7f717940c2 (patch) | |
tree | 392fa55316e3b86bea17c5d01001a4da3457096c /qtip/reporter/console.py | |
parent | 29df737b48ccf31f555d0e4c08a65e14ecb66331 (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>
Diffstat (limited to 'qtip/reporter/console.py')
-rw-r--r-- | qtip/reporter/console.py | 12 |
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 |