Log each test case status in a task 27/42927/1
authorchenjiankun <chenjiankun1@huawei.com>
Mon, 14 Aug 2017 03:09:36 +0000 (03:09 +0000)
committerRoss Brattain <ross.b.brattain@intel.com>
Mon, 25 Sep 2017 07:29:39 +0000 (00:29 -0700)
JIRA: YARDSTICK-785

Currently if one test case failed, we will log error.
But if one case success, we do not have any tips.
We need log success when one case success.

Change-Id: I0f41ac55f2569f44b787133e3f2594a5c5547f4a
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
yardstick/benchmark/core/task.py

index a8447e2..9472f31 100644 (file)
@@ -125,9 +125,10 @@ class Task(object):     # pragma: no cover
             except KeyboardInterrupt:
                 raise
             except Exception:
-                LOG.exception("Running test case %s failed!", case_name)
+                LOG.error('Testcase: "%s" FAILED!!!', case_name, exe_info=True)
                 testcases[case_name] = {'criteria': 'FAIL', 'tc_data': []}
             else:
+                LOG.info('Testcase: "%s" SUCCESS!!!', case_name)
                 testcases[case_name] = {'criteria': 'PASS', 'tc_data': data}
 
             if args.keep_deploy:
@@ -272,7 +273,9 @@ class Task(object):     # pragma: no cover
                     runner = self.run_one_scenario(scenario, output_file)
                     status = runner_join(runner)
                     if status != 0:
-                        LOG.error('Scenario: %s ERROR', scenario.get('type'))
+                        LOG.error('Scenario NO.%s: "%s" ERROR!',
+                                  scenarios.index(scenario) + 1,
+                                  scenario.get('type'))
                         raise RuntimeError
                     self.outputs.update(runner.get_output())
                     result.extend(runner.get_result())