From 429a6eccd0858ffa8cb326c937d2c7ccdf6ffec8 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Fri, 23 Jun 2017 10:49:15 +0200 Subject: Don't display functest report for single test cases When executing a single test case, it is not neccessary to show duplicated information about the result of the test case. The functest report only makes sense when running multiple tests. e.g. functest testcase run vping_ssh The report is still showed when doing: functest testcase run all Change-Id: I92d97d6111ecd9484a14c72cf4bb0c2bbe3ae6bf Signed-off-by: jose.lausuch --- functest/ci/run_tests.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index 430f0ca8..722df14f 100755 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -252,16 +252,18 @@ class Runner(object): msg.add_row([env_var, CONST.__getattribute__(env_var)]) logger.info("Deployment description: \n\n%s\n", msg) - msg = prettytable.PrettyTable( - header_style='upper', padding_width=5, - field_names=['test case', 'project', 'tier', 'duration', 'result']) - for test_case in self.executed_test_cases: - result = 'PASS' if(test_case.is_successful( - ) == test_case.EX_OK) else 'FAIL' - msg.add_row([test_case.case_name, test_case.project_name, - _tiers.get_tier_name(test_case.case_name), - test_case.get_duration(), result]) - logger.info("FUNCTEST REPORT: \n\n%s\n", msg) + if len(self.executed_test_cases) > 1: + msg = prettytable.PrettyTable( + header_style='upper', padding_width=5, + field_names=['test case', 'project', 'tier', + 'duration', 'result']) + for test_case in self.executed_test_cases: + result = 'PASS' if(test_case.is_successful( + ) == test_case.EX_OK) else 'FAIL' + msg.add_row([test_case.case_name, test_case.project_name, + _tiers.get_tier_name(test_case.case_name), + test_case.get_duration(), result]) + logger.info("FUNCTEST REPORT: \n\n%s\n", msg) logger.info("Execution exit value: %s" % self.overall_result) return self.overall_result -- cgit 1.2.3-korg