Merge "Fix rally task detailed --iterations-data"

This commit is contained in:
Jenkins 2015-02-16 11:06:30 +00:00 committed by Gerrit Code Review
commit 98d02dd8c5
2 changed files with 23 additions and 7 deletions

View File

@ -283,16 +283,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)

View File

@ -64,6 +64,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()