diff --git a/rally/benchmark/runners/base.py b/rally/benchmark/runners/base.py index 922c881ce7..8b7a478d93 100644 --- a/rally/benchmark/runners/base.py +++ b/rally/benchmark/runners/base.py @@ -55,11 +55,11 @@ def _run_scenario_once(args): clients=osclients.Clients(context["user"]["endpoint"])) error = [] - scenario_output = {} + scenario_output = {"errors": "", "data": {}} try: with rutils.Timer() as timer: scenario_output = getattr(scenario, - method_name)(**kwargs) or {} + method_name)(**kwargs) or scenario_output except Exception as e: error = utils.format_exc(e) if cfg.CONF.debug: diff --git a/rally/cmd/commands/task.py b/rally/cmd/commands/task.py index f4cf13512c..a1baafefce 100644 --- a/rally/cmd/commands/task.py +++ b/rally/cmd/commands/task.py @@ -235,11 +235,8 @@ class TaskCommands(object): # NOTE(hughsaunders): ssrs=scenario specific results ssrs = [] for result in raw: - try: + if result['scenario_output']['data']: ssrs.append(result['scenario_output']['data']) - except (KeyError, TypeError): - # No SSRs in this result - pass if ssrs: keys = set() for ssr in ssrs: diff --git a/tests/benchmark/runners/test_base.py b/tests/benchmark/runners/test_base.py index c7166c3233..50ac015b28 100644 --- a/tests/benchmark/runners/test_base.py +++ b/tests/benchmark/runners/test_base.py @@ -75,14 +75,14 @@ class ScenarioHelpersTestCase(test.TestCase): args = (1, fakes.FakeScenario, "do_it", context, {}) result = base._run_scenario_once(args) - expected_reuslt = { + expected_result = { "duration": fakes.FakeTimer().duration(), "idle_duration": 0, "error": [], - "scenario_output": {}, + "scenario_output": {"errors": "", "data": {}}, "atomic_actions": [] } - self.assertEqual(expected_reuslt, result) + self.assertEqual(expected_result, result) @mock.patch("rally.benchmark.runners.base.rutils") @mock.patch("rally.benchmark.runners.base.osclients") @@ -93,14 +93,14 @@ class ScenarioHelpersTestCase(test.TestCase): args = (1, fakes.FakeScenario, "with_output", context, {}) result = base._run_scenario_once(args) - expected_reuslt = { + expected_result = { "duration": fakes.FakeTimer().duration(), "idle_duration": 0, "error": [], "scenario_output": fakes.FakeScenario().with_output(), "atomic_actions": [] } - self.assertEqual(expected_reuslt, result) + self.assertEqual(expected_result, result) @mock.patch("rally.benchmark.runners.base.rutils") @mock.patch("rally.benchmark.runners.base.osclients") @@ -110,13 +110,13 @@ class ScenarioHelpersTestCase(test.TestCase): args = (1, fakes.FakeScenario, "something_went_wrong", context, {}) result = base._run_scenario_once(args) expected_error = result.pop("error") - expected_reuslt = { + expected_result = { "duration": fakes.FakeTimer().duration(), "idle_duration": 0, - "scenario_output": {}, + "scenario_output": {"errors": "", "data": {}}, "atomic_actions": [] } - self.assertEqual(expected_reuslt, result) + self.assertEqual(expected_result, result) self.assertEqual(expected_error[:2], [str(Exception), "Something went wrong"])