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

Unified Diff: gm/rebaseline_server/server.py

Issue 212673013: rebaseline_server: add option to read actuals from local disk (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/server.py
diff --git a/gm/rebaseline_server/server.py b/gm/rebaseline_server/server.py
index 46b99ff65a821c99e59cb6a1eedfb1ed908ae593..dff95045d77dfe580f4b4794fddcd86fe471d47d 100755
--- a/gm/rebaseline_server/server.py
+++ b/gm/rebaseline_server/server.py
@@ -149,14 +149,16 @@ class Server(object):
"""
Args:
actuals_dir: directory under which we will check out the latest actual
- GM results
+ GM results
actuals_repo_revision: revision of actual-results.json files to process
- actuals_repo_url: SVN repo to download actual-results.json files from
+ actuals_repo_url: SVN repo to download actual-results.json files from;
+ if None or '', don't fetch new actual-results files at all,
+ just compare to whatever files are already in actuals_dir
port: which TCP port to listen on for HTTP requests
export: whether to allow HTTP clients on other hosts to access this server
editable: whether HTTP clients are allowed to submit new baselines
reload_seconds: polling interval with which to check for new results;
- if 0, don't check for new results at all
+ if 0, don't check for new results at all
"""
self._actuals_dir = actuals_dir
self._actuals_repo_revision = actuals_repo_revision
@@ -165,8 +167,9 @@ class Server(object):
self._export = export
self._editable = editable
self._reload_seconds = reload_seconds
- self._actuals_repo = _create_svn_checkout(
- dir_path=actuals_dir, repo_url=actuals_repo_url)
+ if actuals_repo_url:
+ self._actuals_repo = _create_svn_checkout(
+ dir_path=actuals_dir, repo_url=actuals_repo_url)
# Reentrant lock that must be held whenever updating EITHER of:
# 1. self._results
@@ -214,11 +217,14 @@ class Server(object):
with self.results_rlock:
if invalidate:
self._results = None
- logging.info(
- 'Updating actual GM results in %s to revision %s from repo %s ...' % (
- self._actuals_dir, self._actuals_repo_revision,
- self._actuals_repo_url))
- self._actuals_repo.Update(path='.', revision=self._actuals_repo_revision)
+ if self._actuals_repo_url:
+ logging.info(
+ 'Updating actual GM results in %s to revision %s from repo %s ...'
+ % (
+ self._actuals_dir, self._actuals_repo_revision,
+ self._actuals_repo_url))
+ self._actuals_repo.Update(
+ path='.', revision=self._actuals_repo_revision)
# We only update the expectations dir if the server was run with a
# nonzero --reload argument; otherwise, we expect the user to maintain
@@ -508,7 +514,9 @@ def main():
default=DEFAULT_ACTUALS_DIR)
parser.add_argument('--actuals-repo',
help=('URL of SVN repo to download actual-results.json '
- 'files from. Defaults to %(default)s'),
+ 'files from. Defaults to %(default)s ; if set to '
+ 'empty string, just compare to actual-results '
+ 'already found in ACTUALS_DIR.'),
default=DEFAULT_ACTUALS_REPO_URL)
parser.add_argument('--actuals-revision',
help=('revision of actual-results.json files to process. '
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698