aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rebaseline_server/imagepair.py
diff options
context:
space:
mode:
authorGravatar epoger <epoger@google.com>2014-08-20 08:00:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-20 08:00:28 -0700
commit2c4352bb9db02db70b829f96f397faa80fade220 (patch)
treeb18ff06d99190d6dccd81d6cf241f233f1da7ddc /gm/rebaseline_server/imagepair.py
parent802aa8c15b7e88f5c702c2d10b33b3787dd38f47 (diff)
rebaseline_server: allow users to generate SKP diff patches on a shared instance
This will allow developers to maintain SKP baselines without ever running their own rebaseline_server instance! For now, the developer must manually apply the resulting patchset to his local Skia checkout to actually modify expectations; in the near future, we hope to make the UI upload the patchset to Rietveld on the user's behalf. BUG=skia:1918 NOTRY=true R=stephana@google.com, rmistry@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/487853004
Diffstat (limited to 'gm/rebaseline_server/imagepair.py')
-rw-r--r--gm/rebaseline_server/imagepair.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/gm/rebaseline_server/imagepair.py b/gm/rebaseline_server/imagepair.py
index d9c4cb82b9..0ac0c42138 100644
--- a/gm/rebaseline_server/imagepair.py
+++ b/gm/rebaseline_server/imagepair.py
@@ -20,6 +20,7 @@ KEY__IMAGEPAIRS__EXTRACOLUMNS = 'extraColumns'
KEY__IMAGEPAIRS__IMAGE_A_URL = 'imageAUrl'
KEY__IMAGEPAIRS__IMAGE_B_URL = 'imageBUrl'
KEY__IMAGEPAIRS__IS_DIFFERENT = 'isDifferent'
+KEY__IMAGEPAIRS__SOURCE_JSON_FILE = 'sourceJsonFile'
# If self._diff_record is set to this, we haven't asked ImageDiffDB for the
# image diff details yet.
@@ -32,7 +33,7 @@ class ImagePair(object):
def __init__(self, image_diff_db,
base_url, imageA_relative_url, imageB_relative_url,
- expectations=None, extra_columns=None,
+ expectations=None, extra_columns=None, source_json_file=None,
download_all_images=False):
"""
Args:
@@ -46,6 +47,9 @@ class ImagePair(object):
metadata (ignore-failure, bug numbers, etc.)
extra_columns: optional dictionary containing more metadata (test name,
builder name, etc.)
+ source_json_file: relative path of the JSON file where each image came
+ from; this will be the same for both imageA and imageB, within their
+ respective directories
download_all_images: if True, download any images associated with this
image pair, even if we don't need them to generate diffs
(imageA == imageB, or one of them is missing)
@@ -56,6 +60,7 @@ class ImagePair(object):
self.imageB_relative_url = imageB_relative_url
self.expectations_dict = expectations
self.extra_columns_dict = extra_columns
+ self.source_json_file = source_json_file
if not imageA_relative_url or not imageB_relative_url:
self._is_different = True
self._diff_record = None
@@ -89,6 +94,8 @@ class ImagePair(object):
asdict[KEY__IMAGEPAIRS__EXPECTATIONS] = self.expectations_dict
if self.extra_columns_dict:
asdict[KEY__IMAGEPAIRS__EXTRACOLUMNS] = self.extra_columns_dict
+ if self.source_json_file:
+ asdict[KEY__IMAGEPAIRS__SOURCE_JSON_FILE] = self.source_json_file
if self._diff_record is _DIFF_RECORD_STILL_LOADING:
# We have waited as long as we can to ask ImageDiffDB for details of
# this image diff. Now we must block until ImageDiffDB can provide