=== modified file 'lava_dispatcher/actions/launch_control.py'
@@ -209,7 +209,7 @@
if not all_bundles:
main_bundle = {
"test_runs": [],
- "format": "Dashboard Bundle Format 1.5"
+ "format": "Dashboard Bundle Format 1.6"
}
else:
main_bundle = all_bundles.pop(0)
=== modified file 'lava_dispatcher/actions/lava_test_shell.py'
@@ -204,9 +204,9 @@
def _get_testdef_info(testdef):
metadata = {'os': '', 'devices': '', 'environment': ''}
- metadata['version'] = str(testdef['metadata'].get('version'))
- metadata['description'] = str(testdef['metadata'].get('description'))
- metadata['format'] = str(testdef['metadata'].get('format'))
+ metadata['description'] = testdef['metadata'].get('description', None)
+ metadata['format'] = testdef['metadata'].get('format', None)
+ metadata['version'] = testdef['metadata'].get('version', None)
# Convert list to comma separated string.
if testdef['metadata'].get('os'):
@@ -404,7 +404,7 @@
f.write(self.uuid)
with open('%s/testdef_metadata' % hostdir, 'w') as f:
- f.write(yaml.dump(self.testdef_metadata))
+ f.write(yaml.safe_dump(self.testdef_metadata))
if 'install' in self.testdef:
self._create_repos(hostdir)
@@ -439,8 +439,8 @@
testdef_metadata = {}
testdef_metadata.update({'url': info['branch_url']})
testdef_metadata.update({'location': info['branch_vcs'].upper()})
- testdef_metadata.update({'repo_rev': info['branch_revision']})
testdef_metadata.update(_get_testdef_info(testdef))
+ testdef_metadata.update({'version': info['branch_revision']})
URLTestDefinition.__init__(self, context, idx, testdef,
testdef_metadata)
=== modified file 'lava_dispatcher/lava_test_shell.py'
@@ -284,6 +284,25 @@
return attachments
+def _get_run_testdef_metadata(test_run_dir):
+ testdef_metadata = {
+ 'version': None,
+ 'description': None,
+ 'format': None,
+ 'location': None,
+ 'url': None,
+ 'os': None,
+ 'devices': None,
+ 'environment': None
+ }
+
+ metadata = _read_content(os.path.join(test_run_dir, 'testdef_metadata'))
+ if metadata is not '':
+ testdef_metadata = yaml.safe_load(metadata)
+
+ return testdef_metadata
+
+
def _get_test_run(test_run_dir, hwcontext, build, pkginfo, testdefs_by_uuid):
now = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
@@ -292,11 +311,9 @@
uuid = _read_content(os.path.join(test_run_dir, 'analyzer_assigned_uuid'))
attachments = _get_run_attachments(test_run_dir, testdef, stdout)
attributes = _attributes_from_dir(os.path.join(test_run_dir, 'attributes'))
- # XXX testdef_metadata = _read_content(os.path.join(test_run_dir,
- # XXX 'testdef_metadata'))
testdef = yaml.safe_load(testdef)
- # XXX testdef_metadata = yaml.safe_load(testdef_metadata)
+
if uuid in testdefs_by_uuid:
sw_sources = testdefs_by_uuid[uuid]._sw_sources
else:
@@ -314,8 +331,8 @@
'hardware_context': hwcontext,
'attachments': attachments,
'attributes': attributes,
- # XXX 'testdef_metadata': testdef_metadata,
- }
+ 'testdef_metadata': _get_run_testdef_metadata(test_run_dir)
+ }
def _read_content(filepath, ignore_missing=False):
@@ -354,4 +371,4 @@
except:
logging.exception('error processing results for: %s' % test_run_name)
- return {'test_runs': testruns, 'format': 'Dashboard Bundle Format 1.5'}
+ return {'test_runs': testruns, 'format': 'Dashboard Bundle Format 1.6'}
=== modified file 'lava_dispatcher/test_data.py'
@@ -34,8 +34,7 @@
def __init__(self, test_id='lava'):
self.job_status = 'pass'
self.metadata = {}
- self._test_run = { 'test_results':[], 'attachments':[], 'tags':[], }
- # XXX 'testdef_metadata':{} }
+ self._test_run = { 'test_results':[], 'attachments':[], 'tags':[] }
self._test_run['test_id'] = test_id
self._assign_date()
self._assign_uuid()