diff options
author | zhifeng.jiang <jiang.zhifeng@zte.com.cn> | 2016-10-07 13:12:39 +0800 |
---|---|---|
committer | zhifeng.jiang <jiang.zhifeng@zte.com.cn> | 2016-10-13 09:28:16 +0800 |
commit | f7b4e61fcc20c5814d9b7ed5ebefbec1b549cd03 (patch) | |
tree | b912b940397d6d570cb4865d7c54b20b41e173e7 /restful_server | |
parent | 2dda7f90927934bc5738287b2f8960a4d14bb07e (diff) |
Refactor pushing suite result to test db
modification:
remove compute_suite.py,network_suite.py,storage_suite.py
handler all suite result in suite_result.py
refactor pushtoDB.py so that it can be called by qtip_server
JIRA:QTIP-99
Change-Id: I1630a512c22cba7be038f5301f1454b8ef4f762f
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
Diffstat (limited to 'restful_server')
-rw-r--r-- | restful_server/result_handler.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/restful_server/result_handler.py b/restful_server/result_handler.py new file mode 100644 index 00000000..059a2510 --- /dev/null +++ b/restful_server/result_handler.py @@ -0,0 +1,22 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import json +import data.ref_results.suite_result as suite_result +import dashboard.pushtoDB as push_to_db + + +def dump_suite_result(suite_name): + return suite_result.get_suite_result(suite_name) + + +def push_suite_result_to_db(suite_name, test_db_url, installer_type, node_name): + with open('results/{0}_result.json'.format(suite_name), 'r') as result_file: + j = json.load(result_file) + push_to_db.push_results_to_db(test_db_url, '{0}_test_suite'.format(suite_name), + j, installer_type, node_name) |