Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1274)

Unified Diff: gm/rebaseline_server/compare_rendered_pictures.py

Issue 442203002: rebaseline_server live queries: allow comparison against summary files within the Skia repo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment-only changes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/rebaseline_server/compare_rendered_pictures.py
diff --git a/gm/rebaseline_server/compare_rendered_pictures.py b/gm/rebaseline_server/compare_rendered_pictures.py
index 907ea631366e94604321c406a0def7db521320d7..2f820256dc90b18d2314404f15d81522599a06d3 100755
--- a/gm/rebaseline_server/compare_rendered_pictures.py
+++ b/gm/rebaseline_server/compare_rendered_pictures.py
@@ -55,6 +55,12 @@ ORDERED_COLUMN_IDS = [
COLUMN__TILENUM,
]
+# A special "repo" URL type that we use to refer to Skia repo contents.
+# (Useful for comparing against expectations files we store in our repo.)
+REPO_URL_PREFIX = 'repo:'
+REPO_BASEPATH = os.path.abspath(os.path.join(
+ os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir))
+
class RenderedPicturesComparisons(results.BaseComparisons):
"""Loads results from multiple render_pictures runs into an ImagePairSet.
@@ -68,9 +74,11 @@ class RenderedPicturesComparisons(results.BaseComparisons):
"""
Args:
setA_dirs: list of root directories to copy all JSON summaries from,
- and to use as setA within the comparisons
+ and to use as setA within the comparisons. These directories may be
+ gs:// URLs, special "repo" URLs, or local filepaths.
rmistry 2014/08/06 15:03:52 "repo" -> "repo:" URLs. Similarly below.
epoger 2014/08/06 15:08:19 Done.
setB_dirs: list of root directories to copy all JSON summaries from,
- and to use as setB within the comparisons
+ and to use as setB within the comparisons. These directories may be
+ gs:// URLs, special "repo" URLs, or local filepaths.
image_diff_db: ImageDiffDB instance
image_base_gs_url: "gs://" URL pointing at the Google Storage bucket/dir
under which all render_pictures result images can
@@ -325,7 +333,8 @@ class RenderedPicturesComparisons(results.BaseComparisons):
"""Copy all contents of source_dir into dest_dir, recursing into subdirs.
Args:
- source_dir: path to source dir (GS URL or local filepath)
+ source_dir: path to source dir (GS URL, local filepath, or a special
+ "repo" URL type that points at a file within our Skia checkout)
dest_dir: path to destination dir (local filepath)
The copy operates as a "merge with overwrite": any files in source_dir will
@@ -336,5 +345,8 @@ class RenderedPicturesComparisons(results.BaseComparisons):
(bucket, path) = gs_utils.GSUtils.split_gs_url(source_dir)
self._gs.download_dir_contents(source_bucket=bucket, source_dir=path,
dest_dir=dest_dir)
+ elif source_dir.lower().startswith(REPO_URL_PREFIX):
+ repo_dir = os.path.join(REPO_BASEPATH, source_dir[len(REPO_URL_PREFIX):])
+ shutil.copytree(repo_dir, dest_dir)
else:
shutil.copytree(source_dir, dest_dir)

Powered by Google App Engine
This is Rietveld 408576698