diff options
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py')
-rw-r--r-- | WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py index 84be0e1..6263540 100644 --- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py +++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py @@ -29,14 +29,17 @@ import logging import os -import simplejson import subprocess import sys import time import urllib2 import xml.dom.minidom -from layout_package import test_expectations +from webkitpy.layout_tests.layout_package import test_expectations +import webkitpy.thirdparty.simplejson as simplejson + +_log = logging.getLogger("webkitpy.layout_tests.layout_package." + "json_results_generator") class JSONResultsGenerator(object): @@ -154,8 +157,8 @@ class JSONResultsGenerator(object): # Check if we have the archived JSON file on the buildbot server. results_file_url = (self._builder_base_url + self._build_name + "/" + self.RESULTS_FILENAME) - logging.error("Local results.json file does not exist. Grabbing " - "it off the archive at " + results_file_url) + _log.error("Local results.json file does not exist. Grabbing " + "it off the archive at " + results_file_url) try: results_file = urllib2.urlopen(results_file_url) @@ -177,11 +180,11 @@ class JSONResultsGenerator(object): try: results_json = simplejson.loads(old_results) except: - logging.debug("results.json was not valid JSON. Clobbering.") + _log.debug("results.json was not valid JSON. Clobbering.") # The JSON file is not valid JSON. Just clobber the results. results_json = {} else: - logging.debug('Old JSON results do not exist. Starting fresh.') + _log.debug('Old JSON results do not exist. Starting fresh.') results_json = {} return results_json, error @@ -192,14 +195,14 @@ class JSONResultsGenerator(object): if error: # If there was an error don't write a results.json # file at all as it would lose all the information on the bot. - logging.error("Archive directory is inaccessible. Not modifying " - "or clobbering the results.json file: " + str(error)) + _log.error("Archive directory is inaccessible. Not modifying " + "or clobbering the results.json file: " + str(error)) return None builder_name = self._builder_name if results_json and builder_name not in results_json: - logging.debug("Builder name (%s) is not in the results.json file." - % builder_name) + _log.debug("Builder name (%s) is not in the results.json file." + % builder_name) self._convert_json_to_current_version(results_json) @@ -307,16 +310,20 @@ class JSONResultsGenerator(object): # These next two branches test to see which source repos we can # pull revisions from. if hasattr(self._port, 'path_from_webkit_base'): - path_to_webkit = self._port.path_from_webkit_base() + path_to_webkit = self._port.path_from_webkit_base('WebCore') self._insert_item_into_raw_list(results_for_builder, self._get_svn_revision(path_to_webkit), self.WEBKIT_SVN) if hasattr(self._port, 'path_from_chromium_base'): - path_to_chrome = self._port.path_from_chromium_base() - self._insert_item_into_raw_list(results_for_builder, - self._get_svn_revision(path_to_chrome), - self.CHROME_SVN) + try: + path_to_chrome = self._port.path_from_chromium_base() + self._insert_item_into_raw_list(results_for_builder, + self._get_svn_revision(path_to_chrome), + self.CHROME_SVN) + except AssertionError: + # We're not in a Chromium checkout, that's ok. + pass self._insert_item_into_raw_list(results_for_builder, int(time.time()), |