summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-06-08 10:53:41 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-07-24 11:42:14 -0700
commit840e6e98326daa0ad43c4e2bf1859b086627bc9a (patch)
treec28518a728f74df4168e7550f952f6ed6d1cde2a /framework
parent1a5382f7a57f02190442759c357b40b3db532d06 (diff)
JSON: move info utilities out of root
And into a generic sub element in the output. This makes information like glxinfo and clinfo not a hard requirement and will allow any sort of system information to be encoded.
Diffstat (limited to 'framework')
-rw-r--r--framework/backends/json.py16
-rw-r--r--framework/programs/run.py3
-rw-r--r--framework/results.py10
-rw-r--r--framework/summary/html_.py8
4 files changed, 23 insertions, 14 deletions
diff --git a/framework/backends/json.py b/framework/backends/json.py
index 882169e09..46ea6f7bc 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -53,7 +53,7 @@ __all__ = [
]
# The current version of the JSON results
-CURRENT_JSON_VERSION = 9
+CURRENT_JSON_VERSION = 10
# The minimum JSON format supported
MINIMUM_SUPPORTED_VERSION = 7
@@ -322,6 +322,7 @@ def _update_results(results, filepath):
updates = {
7: _update_seven_to_eight,
8: _update_eight_to_nine,
+ 9: _update_nine_to_ten,
}
while results['results_version'] < CURRENT_JSON_VERSION:
@@ -400,6 +401,19 @@ def _update_eight_to_nine(result):
return result
+def _update_nine_to_ten(result):
+ result['info'] = {}
+ result['info']['system'] = {}
+ for e in ['glxinfo', 'wglinfo', 'clinfo', 'lspci', 'uname']:
+ r = result.pop(e)
+ if r:
+ result['info']['system'][e] = r
+
+ result['results_version'] = 10
+
+ return result
+
+
REGISTRY = Registry(
extensions=['.json'],
backend=JSONBackend,
diff --git a/framework/programs/run.py b/framework/programs/run.py
index 151762fc5..8011a2966 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -259,7 +259,8 @@ def _create_metadata(args, name, forced_test_list):
metadata = {'options': opts}
metadata['name'] = name
- metadata.update(core.collect_system_info())
+ metadata['info'] = {}
+ metadata['info']['system'] = core.collect_system_info()
return metadata
diff --git a/framework/results.py b/framework/results.py
index b936298c3..31cb8dff3 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -298,13 +298,8 @@ class Totals(dict):
class TestrunResult(object):
"""The result of a single piglit run."""
def __init__(self):
- self.name = None
- self.uname = None
+ self.info = {}
self.options = {}
- self.glxinfo = None
- self.wglinfo = None
- self.clinfo = None
- self.lspci = None
self.time_elapsed = TimeAttribute()
self.tests = collections.OrderedDict()
self.totals = collections.defaultdict(Totals)
@@ -372,8 +367,7 @@ class TestrunResult(object):
"""
res = cls()
- for name in ['name', 'uname', 'options', 'glxinfo', 'wglinfo', 'lspci',
- 'results_version', 'clinfo']:
+ for name in ['name', 'info', 'options', 'results_version']:
value = dict_.get(name)
if value:
setattr(res, name, value)
diff --git a/framework/summary/html_.py b/framework/summary/html_.py
index 14dd76fa8..945230bc6 100644
--- a/framework/summary/html_.py
+++ b/framework/summary/html_.py
@@ -100,10 +100,10 @@ def _make_testrun_info(results, destination, exclude=None):
totals=each.totals['root'],
time=each.time_elapsed.delta,
options=each.options,
- uname=each.uname,
- glxinfo=each.glxinfo,
- clinfo=each.clinfo,
- lspci=each.lspci))
+ uname=each.info['system'].get('uname'),
+ glxinfo=each.info['system'].get('glxinfo'),
+ clinfo=each.info['system'].get('clinfo'),
+ lspci=each.info['system'].get('lspci')))
# Then build the individual test results
for key, value in six.iteritems(each.tests):