aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-02-08 15:18:24 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2017-02-13 13:51:40 +0100
commit00bf0cae0160ff8318a455bd0dc80911a8a1d707 (patch)
tree57f2b4f25c1d7985eaa8a0a0c4c0e597b9d0b2ff /functest/utils
parent8eef71278d06f2fd91b99e6be19069ba077c2d29 (diff)
Revert "write test results to a local file"
This reverts commit ee21af78fbfc93e888acda121f08d2b216dd0159. Change-Id: If7c8d3b645073574862eb67225b1e11b0dd7a021 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/utils')
-rw-r--r--functest/utils/functest_utils.py34
1 files changed, 1 insertions, 33 deletions
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py
index 04055464..23a51ff2 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -23,10 +23,8 @@ import requests
import yaml
from git import Repo
-from functest.utils.constants import CONST
import functest.utils.functest_logger as ft_logger
-
logger = ft_logger.Logger("functest_utils").getLogger()
@@ -184,43 +182,13 @@ def logger_test_results(project, case_name, status, details):
'd': details})
-def write_results_to_file(project, case_name, start_date,
- stop_date, criteria, details):
- file_path = re.split(r'://', CONST.results_test_db_url)[1]
-
- try:
- installer = os.environ['INSTALLER_TYPE']
- scenario = os.environ['DEPLOY_SCENARIO']
- pod_name = os.environ['NODE_NAME']
- except KeyError as e:
- logger.error("Please set env var: " + str(e))
- return False
-
- test_start = dt.fromtimestamp(start_date).strftime('%Y-%m-%d %H:%M:%S')
- test_stop = dt.fromtimestamp(stop_date).strftime('%Y-%m-%d %H:%M:%S')
-
- params = {"project_name": project, "case_name": case_name,
- "pod_name": pod_name, "installer": installer,
- "scenario": scenario, "criteria": criteria,
- "start_date": test_start, "stop_date": test_stop,
- "details": details}
- try:
- with open(file_path, "a+w") as outfile:
- json.dump(params, outfile)
- outfile.write("\n")
- return True
- except Exception as e:
- logger.error("write result data into a file failed: %s" % e)
- return False
-
-
def push_results_to_db(project, case_name,
start_date, stop_date, criteria, details):
"""
POST results to the Result target DB
"""
# Retrieve params from CI and conf
- url = CONST.results_test_db_url + "/results"
+ url = get_db_url() + "/results"
try:
installer = os.environ['INSTALLER_TYPE']