aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2016-12-02 01:39:32 +0000
committerchenjiankun <chenjiankun1@huawei.com>2016-12-02 01:39:32 +0000
commitdfe01b8db0d51bcaaa6c5ddc67eaf250458c6409 (patch)
treea385b9a051f0c79540d8d8513e9427cfa577a6ef /api
parentfad4811d1a722f2577f158840b7c8e61489e2e90 (diff)
Add support for sample testcase to get test result
JIRA: YARDSTICK-440 Change-Id: I15234e833353a33b063993b96f1f787ddf649720 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'api')
-rw-r--r--api/actions/result.py8
1 files changed, 5 insertions, 3 deletions
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)