From 811e5a717c41fa865f4ef9ffed6a74eec2002290 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 5 Dec 2014 18:00:50 -0500 Subject: [PATCH] Add support to the subunit workers to reuse zuul uuids The latest subunit2sql release, 0.2.1, added support for setting the id for a run. This commit adds support to the gearman workers for doing this using the zuul build_uuids. This way if an event has a build_uuid set in the metadata the id column for the row will match zuul's. This will be useful for when eventually want to correlate data between zuul and subunit2sql. Change-Id: Ic4aa13a6c92c3bc759e080fdc4c2e07ff8b881bd --- files/subunit-gearman-worker.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/subunit-gearman-worker.py b/files/subunit-gearman-worker.py index dd1d125..4863812 100644 --- a/files/subunit-gearman-worker.py +++ b/files/subunit-gearman-worker.py @@ -181,6 +181,9 @@ class Subunit2SQLProcessor(object): if log_url: log_dir = os.path.dirname(os.path.dirname(log_url)) shell.CONF.set_override('artifacts', log_dir) + run_id = subunit.get('build_uuid', None) + if run_id: + shell.CONF.set_override('run_id', run_id) shell.CONF.set_override('run_meta', subunit) # Parse subunit stream and store in DB logging.debug('Converting Subunit V2 stream to SQL')