diff --git a/rally/cmd/commands/task.py b/rally/cmd/commands/task.py index 6438ad8189..55d05331d9 100644 --- a/rally/cmd/commands/task.py +++ b/rally/cmd/commands/task.py @@ -273,16 +273,11 @@ class TaskCommands(object): for col in float_cols])) for (c, r) in enumerate(raw_data, 1): dlist = [c] + dlist.append(r["duration"]) if r["atomic_actions"]: - dlist.append(r["duration"]) for action in atomic_actions: dlist.append(r["atomic_actions"].get(action) or 0) - table_rows.append(rutils.Struct(**dict(zip(headers, - dlist)))) - else: - data = dlist + [None for i in range(1, len(headers))] - table_rows.append(rutils.Struct(**dict(zip(headers, - data)))) + table_rows.append(rutils.Struct(**dict(zip(headers, dlist)))) common_cliutils.print_list(table_rows, fields=headers, formatters=formatters) diff --git a/tests/functional/test_cli_task.py b/tests/functional/test_cli_task.py index 81db910d81..8bec5a0ae4 100644 --- a/tests/functional/test_cli_task.py +++ b/tests/functional/test_cli_task.py @@ -63,6 +63,27 @@ class TaskTestCase(unittest.TestCase): self.assertIn("dummy_fail_test (2)", detailed) detailed_iterations_data = rally("task detailed --iterations-data") self.assertIn("2. dummy_fail_test (2)", detailed_iterations_data) + self.assertNotIn("n/a", detailed_iterations_data) + + def test_detailed_no_atomic_actions(self): + rally = utils.Rally() + cfg = { + "Dummy.dummy": [ + { + "runner": { + "type": "constant", + "times": 100, + "concurrency": 5 + } + } + ] + } + config = utils.TaskConfig(cfg) + rally("task start --task %s" % config.filename) + detailed = rally("task detailed") + self.assertIn("Dummy.dummy", detailed) + detailed_iterations_data = rally("task detailed --iterations-data") + self.assertNotIn("n/a", detailed_iterations_data) def test_results(self): rally = utils.Rally()