diff options
author | ojan@chromium.org <ojan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 00:00:49 +0000 |
---|---|---|
committer | ojan@chromium.org <ojan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 00:00:49 +0000 |
commit | 7cfc63985f209cd3f74c81325c7476c64dc4f6c7 (patch) | |
tree | 34ee0c9108dbc705f83b6e008e3b43311c45aaf0 | |
parent | c2b38043d0086828d844b3ad7065dbcb47c9b85d (diff) | |
download | chromium_src-7cfc63985f209cd3f74c81325c7476c64dc4f6c7.zip chromium_src-7cfc63985f209cd3f74c81325c7476c64dc4f6c7.tar.gz chromium_src-7cfc63985f209cd3f74c81325c7476c64dc4f6c7.tar.bz2 |
Fix paths in the dashboard JSON on windows.
Review URL: http://codereview.chromium.org/548047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36309 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/layout_tests/layout_package/json_results_generator.py | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/webkit/tools/layout_tests/layout_package/json_results_generator.py b/webkit/tools/layout_tests/layout_package/json_results_generator.py index 04acba2..22c5cc6 100644 --- a/webkit/tools/layout_tests/layout_package/json_results_generator.py +++ b/webkit/tools/layout_tests/layout_package/json_results_generator.py @@ -25,11 +25,11 @@ class JSONResultsGenerator: MIN_TIME = 1 JSON_PREFIX = "ADD_RESULTS(" JSON_SUFFIX = ");" - WEBKIT_PATH = "WebKit/LayoutTests" + LAYOUT_TESTS_PATH = "LayoutTests" PASS_RESULT = "P" SKIP_RESULT = "X" NO_DATA_RESULT = "N" - VERSION = 2 + VERSION = 3 VERSION_KEY = "version" RESULTS = "results" TIMES = "times" @@ -126,9 +126,9 @@ class JSONResultsGenerator: We would return fast/forms/foo.html """ - index = test.find(self.WEBKIT_PATH) + index = test.find(self.LAYOUT_TESTS_PATH) if index is not -1: - index += len(self.WEBKIT_PATH) + index += len(self.LAYOUT_TESTS_PATH) if index is -1: # Already a relative path. @@ -150,8 +150,6 @@ class JSONResultsGenerator: if not test in failures_for_json: failures_for_json[test] = ResultAndTime(test, self._all_tests) # Floor for now to get time in seconds. - # TODO(ojan): As we make tests faster, reduce to tenth of a second - # granularity. failures_for_json[test].time = int(self._test_timings[test]) # If results file exists, read it out, put new info in it. @@ -194,14 +192,15 @@ class JSONResultsGenerator: try: results_json = simplejson.loads(old_results) except: - logging.error("results.json was not valid JSON. Clobbering.") + logging.debug("results.json was not valid JSON. Clobbering.") # The JSON file is not valid JSON. Just clobber the results. results_json = {} if builder_name not in results_json: - logging.error("Builder name (%s) is not in the results.json file." % + logging.debug("Builder name (%s) is not in the results.json file." % builder_name); else: + logging.debug('Old JSON results do not exist. Starting fresh.'); results_json = {} self._ConvertJSONToCurrentVersion(results_json) @@ -350,17 +349,19 @@ class JSONResultsGenerator: results_json[self.VERSION_KEY] == self.VERSION): return - if (self.VERSION_KEY in results_json and - results_json[self.VERSION_KEY] == 1 and - self.TESTS in results_json): - # Convert all the test names from LayoutTests/X to X - LAYOUTTESTS_PREFIX = 'LayoutTests/' - test_results = results_json[self.TESTS] - for test in test_results.keys(): - if test.startswith(LAYOUTTESTS_PREFIX): - new_test = test[len(LAYOUTTESTS_PREFIX):] - test_results[new_test] = test_results[test] - del test_results[test] + if results_json[self.VERSION_KEY] == 2: + for results_for_builder in results_json.itervalues(): + try: + test_results = results_for_builder[self.TESTS] + except: + continue + + for test in test_results: + # Make sure all paths are relative + test_path = self._GetPathRelativeToLayoutTestRoot(test) + if test_path != test: + test_results[test_path] = test_results[test] + del test_results[test] results_json[self.VERSION_KEY] = self.VERSION |