summaryrefslogtreecommitdiff
path: root/framework/results.py
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-03-12 11:31:13 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-03-20 11:04:19 -0700
commitf6c7a3992e2797325c16d3987c1d817fa7edf7c1 (patch)
treeeec1587ca4dbccfa69dabda6517fc149ce48fffc /framework/results.py
parente18e969cf9b796231d05e0935e62efa612109b6d (diff)
framework: change group separator from '/' to '@'
While / is convenient, since python provides a convenient posixpath module for working with paths, which was to our advantage too. The problem of course is that for posix users os.path.join and grouptools.join are equivalent, so they happily mix the two. This doesn't work out so well for windows users though, for whom os.path.join and grouptools.join are not equivalent. This patch replaces the use of / and \ with @, a character that no os uses for paths. This will hopefully put an end to the accidental mixing, or at least force people to use grouptools.from_path. v2: - Also replace \ with @ (Emil) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'framework/results.py')
-rw-r--r--framework/results.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/framework/results.py b/framework/results.py
index 5807be4f8..3b8fc67c2 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -244,6 +244,7 @@ def update_results(results, filepath):
1: _update_one_to_two,
2: _update_two_to_three,
3: _update_three_to_four,
+ 4: _update_four_to_five,
}
while results.results_version < CURRENT_JSON_VERSION:
@@ -462,3 +463,16 @@ def _update_three_to_four(results):
results.results_version = 4
return results
+
+
+def _update_four_to_five(results):
+ """Updates json results from version 4 to version 5."""
+ new_tests = {}
+
+ for name, test in results.tests.iteritems():
+ new_tests[name.replace('/', '@').replace('\\', '@')] = test
+
+ results.tests = new_tests
+ results.results_version = 5
+
+ return results