From 00bf0cae0160ff8318a455bd0dc80911a8a1d707 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 8 Feb 2017 15:18:24 +0100 Subject: Revert "write test results to a local file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ee21af78fbfc93e888acda121f08d2b216dd0159. Change-Id: If7c8d3b645073574862eb67225b1e11b0dd7a021 Signed-off-by: Cédric Ollivier --- functest/utils/functest_utils.py | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'functest/utils/functest_utils.py') diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 040554642..23a51ff23 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'] -- cgit 1.2.3-korg