import os import posixpath import re import urllib2 # Must fix up PYTHONPATH before importing from within Skia import rs_fixpypath # pylint: disable=W0611 # Imports from within Skia from py.utils import gs_utils from py.utils import url_utils import buildbot_globals import gm_json GM_SUMMARIES_BUCKET = buildbot_globals.Get('gm_summaries_bucket') DEFAULT_ACTUALS_BASE_URL = ( 'http://storage.googleapis.com/%s' % GM_SUMMARIES_BUCKET) DEFAULT_JSON_FILENAME = 'actual-results.json' class Download(object): def __init__(self, actuals_base_url=DEFAULT_ACTUALS_BASE_URL, json_filename=DEFAULT_JSON_FILENAME, gm_actuals_root_url=gm_json.GM_ACTUALS_ROOT_HTTP_URL): """ Args: actuals_base_url: URL pointing at the root directory containing all actual-results.json files, e.g., http://domain.name/path/to/dir OR
_GM_SUMMARY_TYPES = [ results_mod.KEY__HEADER__RESULTS_FAILURES, results_mod.KEY__HEADER__RESULTS_ALL, ] # If --compare-configs is specified, compare these configs. CONFIG_PAIRS_TO_COMPARE = [('8888', 'gpu')] # SKP results that are available to compare. # # TODO(stephana): We don't actually want to maintain this list of platforms. # We are just putting them in here for now, as "convenience" links for testing # SKP diffs. # Ultimately, we will depend on buildbot steps linking to their own diffs on # the shared rebaseline_server instance. _SKP_BASE_GS_URL = 'gs://' + buildbot_globals.Get('skp_summaries_bucket') _SKP_BASE_REPO_URL = (compare_rendered_pictures.REPO_URL_PREFIX + posixpath.join('expectations', 'skp')) _SKP_PLATFORMS = [ 'Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug', 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release', ] _HTTP_HEADER_CONTENT_LENGTH = 'Content-Length' _HTTP_HEADER_CONTENT_TYPE = 'Content-Type' _SERVER = None # This gets filled in by main() def _run_command(args, directory): """Runs a command and returns stdout as a single string.
# so any dirs that are already in the PYTHONPATH will be preferred. # # TODO(epoger): Is it OK for this to depend on the 'tools' dir, given that # the tools dir is dependent on the 'gm' dir (to import gm_json.py)? TRUNK_DIRECTORY = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) GM_DIRECTORY = os.path.join(TRUNK_DIRECTORY, 'gm') TOOLS_DIRECTORY = os.path.join(TRUNK_DIRECTORY, 'tools') if GM_DIRECTORY not in sys.path: sys.path.append(GM_DIRECTORY) if TOOLS_DIRECTORY not in sys.path: sys.path.append(TOOLS_DIRECTORY) import buildbot_globals import gm_json DEFAULT_ACTUALS_BASE_URL = posixpath.join( buildbot_globals.Get('autogen_svn_url'), 'gm-actual') DEFAULT_JSON_FILENAME = 'actual-results.json' class Download(object): def __init__(self, actuals_base_url=DEFAULT_ACTUALS_BASE_URL, json_filename=DEFAULT_JSON_FILENAME, gm_actuals_root_url=gm_json.GM_ACTUALS_ROOT_HTTP_URL): """ Args: actuals_base_url: URL pointing at the root directory containing all actual-results.json files, e.g., http://domain.name/path/to/dir OR file:///absolute/path/to/localdir json_filename: The JSON filename to read from within each directory.
from py.utils import gs_utils from py.utils import url_utils import buildbot_globals import column import gm_json import imagediffdb import imagepair import imagepairset import results # URL under which all render_pictures images can be found in Google Storage. # # TODO(epoger): In order to allow live-view of GMs and other images, read this # from the input summary files, or allow the caller to set it within the # GET_live_results call. DEFAULT_IMAGE_BASE_GS_URL = 'gs://' + buildbot_globals.Get('skp_images_bucket') # Column descriptors, and display preferences for them. COLUMN__RESULT_TYPE = results.KEY__EXTRACOLUMNS__RESULT_TYPE COLUMN__SOURCE_SKP = 'sourceSkpFile' COLUMN__TILED_OR_WHOLE = 'tiledOrWhole' COLUMN__TILENUM = 'tilenum' COLUMN__BUILDER_A = 'builderA' COLUMN__RENDER_MODE_A = 'renderModeA' COLUMN__BUILDER_B = 'builderB' COLUMN__RENDER_MODE_B = 'renderModeB' # Known values for some of those columns. COLUMN__TILED_OR_WHOLE__TILED = 'tiled' COLUMN__TILED_OR_WHOLE__WHOLE = 'whole' FREEFORM_COLUMN_IDS = [