Ensure we set attrs in test_ids for sql2subunit

This commit adds any attrs stored in the database to the test_id
written to the subunit stream. This is to make the resulting stream
from sql2subunit more closely match what was passed into the database.

Change-Id: I96e26deea13c60ca6c7698e9bcefe87a7dcda938
This commit is contained in:
Matthew Treinish 2014-12-16 18:20:07 -05:00
parent a5cbdd3d51
commit 50f25cbb2d

View File

@ -63,6 +63,8 @@ def write_test(output, start_time, stop_time, status, test_id, metadatas):
tags = metadatas['tags']
write_status = functools.partial(write_status,
test_tags=tags.split(','))
if 'attrs' in metadatas:
test_id = test_id + '[' + metadatas['attrs'] + ']'
start_time = convert_datetime(start_time)
write_status = functools.partial(write_status,
timestamp=start_time)