From c6276aad7b90561fa97d45ea1020b061b7c9ccd1 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Fri, 29 Jul 2016 15:16:14 +0800 Subject: unify test results logger and apply to parser refine a unified method to log the test results and use it to parser. JIRA: FUNCTEST-397 Change-Id: I5ed6b04107be5590b1d9d5683c8f1846fef5a4d4 Signed-off-by: SerenaFeng --- utils/functest_utils.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'utils') diff --git a/utils/functest_utils.py b/utils/functest_utils.py index b46dc7dda..a21ac4466 100644 --- a/utils/functest_utils.py +++ b/utils/functest_utils.py @@ -163,6 +163,27 @@ def get_db_url(logger=None): return db_url +def logger_test_results(logger, project, case_name, status, details): + pod_name = get_pod_name(logger) + scenario = get_scenario(logger) + version = get_version(logger) + build_tag = get_build_tag(logger) + + logger.info("Pushing %(p)s/%(n)s results: TEST_DB_URL=%(db)s " + "pod_name=%(pod)s version=%(v)s scenario=%(s)s " + "criteria=%(c)s details=%(d)s" % { + 'p': project, + 'n': case_name, + 'db': get_db_url(), + 'pod': pod_name, + 'v': version, + 's': scenario, + 'c': status, + 'b': build_tag, + 'd': details, + }) + + def push_results_to_db(project, case_name, logger, start_date, stop_date, criteria, details): """ -- cgit 1.2.3-korg