From dfe01b8db0d51bcaaa6c5ddc67eaf250458c6409 Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Fri, 2 Dec 2016 01:39:32 +0000 Subject: Add support for sample testcase to get test result JIRA: YARDSTICK-440 Change-Id: I15234e833353a33b063993b96f1f787ddf649720 Signed-off-by: chenjiankun --- api/actions/result.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'api/actions') diff --git a/api/actions/result.py b/api/actions/result.py index 10112ac68..1f200fbcc 100644 --- a/api/actions/result.py +++ b/api/actions/result.py @@ -30,8 +30,6 @@ def getResult(args): message = 'measurement and task_id must be provided' return common_utils.error_handler(message) - measurement = conf.TEST_CASE_PRE + measurement - query_template = "select * from %s where task_id='%s'" query_sql = query_template % ('tasklist', task_id) data = common_utils.translate_to_str(influx_utils.query(query_sql)) @@ -40,8 +38,12 @@ def getResult(args): return common_utils.result_handler(0, []) def _finished(): - query_sql = query_template % (measurement, task_id) + query_sql = query_template % (conf.TEST_CASE_PRE + measurement, + task_id) data = common_utils.translate_to_str(influx_utils.query(query_sql)) + if not data: + query_sql = query_template % (measurement, task_id) + data = common_utils.translate_to_str(influx_utils.query(query_sql)) return common_utils.result_handler(1, data) -- cgit 1.2.3-korg