summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-08-24 15:14:01 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-10-07 13:21:19 -0700
commit97b9d2ddd95d5e6b7ae3a2aa089b360bee428039 (patch)
treea3523ce965e5eaadd6cc3a12a32a5f511c191462 /framework
parent6c7793d04d529333f07a6396330b623a2f4c6d71 (diff)
framework: Bump JSON on disk format to version 9
This change makes the TestResult.pid field into a list of ints instead of a list. This will be used by the multiple test per process tests to ensure that all PIDs are recorded when the cherry features is invoked. This is groundwork for later patches in the series. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/backends/json.py18
-rw-r--r--framework/results.py2
-rw-r--r--framework/test/base.py2
3 files changed, 19 insertions, 3 deletions
diff --git a/framework/backends/json.py b/framework/backends/json.py
index 69f531936..f279f2fb6 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 = 8
+CURRENT_JSON_VERSION = 9
# The level to indent a final file
INDENT = 4
@@ -339,6 +339,7 @@ def _update_results(results, filepath):
5: _update_five_to_six,
6: _update_six_to_seven,
7: _update_seven_to_eight,
+ 8: _update_eight_to_nine,
}
while results.results_version < CURRENT_JSON_VERSION:
@@ -636,6 +637,21 @@ def _update_seven_to_eight(result):
return result
+def _update_eight_to_nine(result):
+ """Update json results from version 8 to 9.
+
+ This changes the PID feild of the TestResult object to alist of Integers or
+ null rather than a single integer or null.
+
+ """
+ for test in compat.viewvalues(result.tests):
+ test.pid = [test.pid]
+
+ result.results_version = 9
+
+ return result
+
+
REGISTRY = Registry(
extensions=['', '.json'],
backend=JSONBackend,
diff --git a/framework/results.py b/framework/results.py
index 756d26109..f9ddcb4cd 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -162,7 +162,7 @@ class TestResult(object):
self.images = None
self.traceback = None
self.exception = None
- self.pid = None
+ self.pid = []
if result:
self.result = result
else:
diff --git a/framework/test/base.py b/framework/test/base.py
index 63fcaf4c4..b667b1569 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -322,7 +322,7 @@ class Test(object):
universal_newlines=True,
**_EXTRA_POPEN_ARGS)
- self.result.pid = proc.pid
+ self.result.pid.append(proc.pid)
if not _SUPPRESS_TIMEOUT:
out, err = proc.communicate(timeout=self.timeout)
else: