Commit 26fcd20c authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Allow override of Gold diff instance

Stops hardcoding an appended '-public' onto the instance we use for
the Diff step in the Gold code, instead calling a method to get which
instance to use. This is because not all uses of Gold, e.g. ANGLE's,
can use the public instance (because it doesn't exist). These cases
can override the method to return the base/internal instance instead.

Bug: skia:10778
Change-Id: I94de33cac9a7f6935ae1507461c75be0fbc01170
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2436649
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarJamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811548}
parent 782e8294
...@@ -345,10 +345,7 @@ class SkiaGoldSession(object): ...@@ -345,10 +345,7 @@ class SkiaGoldSession(object):
'--corpus', '--corpus',
self._corpus, self._corpus,
'--instance', '--instance',
# TODO(skbug.com/10610): Decide whether to use the public or self._GetDiffGoldInstance(),
# non-public instance once authentication is fixed for the non-public
# instance.
str(self._instance) + '-public',
'--input', '--input',
png_file, png_file,
'--test', '--test',
...@@ -470,6 +467,17 @@ class SkiaGoldSession(object): ...@@ -470,6 +467,17 @@ class SkiaGoldSession(object):
def _CreateDiffOutputDir(self): def _CreateDiffOutputDir(self):
return tempfile.mkdtemp(dir=self._working_dir) return tempfile.mkdtemp(dir=self._working_dir)
def _GetDiffGoldInstance(self):
"""Gets the Skia Gold instance to use for the Diff step.
This can differ based on how a particular instance is set up, mainly
depending on whether it is set up for internal results or not.
"""
# TODO(skbug.com/10610): Decide whether to use the public or
# non-public instance once authentication is fixed for the non-public
# instance.
return str(self._instance) + '-public'
def _StoreDiffLinks(self, image_name, output_manager, output_dir): def _StoreDiffLinks(self, image_name, output_manager, output_dir):
"""Stores the local diff files as links. """Stores the local diff files as links.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment