aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rebaseline_server
diff options
context:
space:
mode:
authorGravatar epoger <epoger@google.com>2014-07-11 08:52:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-11 08:52:35 -0700
commit133931f4abdafa5bb0bdea3a02af1e5a70d5ac98 (patch)
tree35453b87e8ca21cc2108fa27eee932c91e50fe62 /gm/rebaseline_server
parent3a21d61668e0ac6529f9930669dd47be123ec333 (diff)
roll "common" DEPS, and replace tools/pyutils with it
BUG=skia:2682 R=borenet@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/385783002
Diffstat (limited to 'gm/rebaseline_server')
-rwxr-xr-xgm/rebaseline_server/compare_configs.py16
-rwxr-xr-xgm/rebaseline_server/compare_rendered_pictures.py25
-rwxr-xr-xgm/rebaseline_server/compare_to_expectations.py6
-rwxr-xr-xgm/rebaseline_server/download_actuals.py8
-rwxr-xr-xgm/rebaseline_server/download_actuals_test.py9
-rwxr-xr-xgm/rebaseline_server/fix_pythonpath.py15
-rwxr-xr-xgm/rebaseline_server/results.py4
-rwxr-xr-xgm/rebaseline_server/server.py6
8 files changed, 45 insertions, 44 deletions
diff --git a/gm/rebaseline_server/compare_configs.py b/gm/rebaseline_server/compare_configs.py
index 4075da4263..cdc19dd831 100755
--- a/gm/rebaseline_server/compare_configs.py
+++ b/gm/rebaseline_server/compare_configs.py
@@ -11,15 +11,14 @@ Compare GM results for two configs, across all builders.
# System-level imports
import argparse
-import fnmatch
-import json
import logging
-import re
import time
+# Must fix up PYTHONPATH before importing from within Skia
+import fix_pythonpath # pylint: disable=W0611
+
# Imports from within Skia
-import fix_pythonpath # must do this first
-from pyutils import url_utils
+from py.utils import url_utils
import gm_json
import imagediffdb
import imagepair
@@ -112,7 +111,7 @@ class ConfigComparisons(results.BaseComparisons):
tests_found = set()
for image_name in sorted(results_of_this_type.keys()):
- (test, config) = results.IMAGE_FILENAME_RE.match(image_name).groups()
+ (test, _) = results.IMAGE_FILENAME_RE.match(image_name).groups()
tests_found.add(test)
for test in tests_found:
@@ -160,9 +159,10 @@ class ConfigComparisons(results.BaseComparisons):
failing_image_pairs.add_image_pair(image_pair)
except (KeyError, TypeError):
logging.exception(
- 'got exception while creating ImagePair for image_name '
- '"%s", builder "%s"' % (image_name, builder))
+ 'got exception while creating ImagePair for test '
+ '"%s", builder "%s"' % (test, builder))
+ # pylint: disable=W0201
self._results = {
results.KEY__HEADER__RESULTS_ALL: all_image_pairs.as_dict(),
results.KEY__HEADER__RESULTS_FAILURES: failing_image_pairs.as_dict(),
diff --git a/gm/rebaseline_server/compare_rendered_pictures.py b/gm/rebaseline_server/compare_rendered_pictures.py
index 73d0627ba0..a48d1c5763 100755
--- a/gm/rebaseline_server/compare_rendered_pictures.py
+++ b/gm/rebaseline_server/compare_rendered_pictures.py
@@ -12,12 +12,13 @@ Compare results of two render_pictures runs.
# System-level imports
import logging
import os
-import re
import time
+# Must fix up PYTHONPATH before importing from within Skia
+import fix_pythonpath # pylint: disable=W0611
+
# Imports from within Skia
-import fix_pythonpath # must do this first
-from pyutils import url_utils
+from py.utils import url_utils
import gm_json
import imagediffdb
import imagepair
@@ -25,9 +26,14 @@ import imagepairset
import results
# URL under which all render_pictures images can be found in Google Storage.
+#
+# pylint: disable=C0301
# TODO(epoger): Move this default value into
# https://skia.googlesource.com/buildbot/+/master/site_config/global_variables.json
-DEFAULT_IMAGE_BASE_URL = 'http://chromium-skia-gm.commondatastorage.googleapis.com/render_pictures/images'
+# pylint: enable=C0301
+DEFAULT_IMAGE_BASE_URL = (
+ 'http://chromium-skia-gm.commondatastorage.googleapis.com/'
+ 'render_pictures/images')
class RenderedPicturesComparisons(results.BaseComparisons):
@@ -145,14 +151,15 @@ class RenderedPicturesComparisons(results.BaseComparisons):
image_dict_A=tiled_images_A[tile_num],
image_dict_B=tiled_images_B[tile_num]))
- for imagepair in imagepairs_for_this_skp:
- if imagepair:
- all_image_pairs.add_image_pair(imagepair)
- result_type = imagepair.extra_columns_dict\
+ for one_imagepair in imagepairs_for_this_skp:
+ if one_imagepair:
+ all_image_pairs.add_image_pair(one_imagepair)
+ result_type = one_imagepair.extra_columns_dict\
[results.KEY__EXTRACOLUMNS__RESULT_TYPE]
if result_type != results.KEY__RESULT_TYPE__SUCCEEDED:
- failing_image_pairs.add_image_pair(imagepair)
+ failing_image_pairs.add_image_pair(one_imagepair)
+ # pylint: disable=W0201
self._results = {
results.KEY__HEADER__RESULTS_ALL: all_image_pairs.as_dict(),
results.KEY__HEADER__RESULTS_FAILURES: failing_image_pairs.as_dict(),
diff --git a/gm/rebaseline_server/compare_to_expectations.py b/gm/rebaseline_server/compare_to_expectations.py
index dad206d0c8..cdd03bed72 100755
--- a/gm/rebaseline_server/compare_to_expectations.py
+++ b/gm/rebaseline_server/compare_to_expectations.py
@@ -17,12 +17,10 @@ import os
import time
# Must fix up PYTHONPATH before importing from within Skia
-# pylint: disable=W0611
-import fix_pythonpath
-# pylint: enable=W0611
+import fix_pythonpath # pylint: disable=W0611
# Imports from within Skia
-from pyutils import url_utils
+from py.utils import url_utils
import column
import gm_json
import imagediffdb
diff --git a/gm/rebaseline_server/download_actuals.py b/gm/rebaseline_server/download_actuals.py
index 2f92898fd4..a619f71ae4 100755
--- a/gm/rebaseline_server/download_actuals.py
+++ b/gm/rebaseline_server/download_actuals.py
@@ -16,10 +16,12 @@ import posixpath
import re
import urllib2
+# Must fix up PYTHONPATH before importing from within Skia
+import fix_pythonpath # pylint: disable=W0611
+
# Imports from within Skia
-import fix_pythonpath # must do this first
-from pyutils import gs_utils
-from pyutils import url_utils
+from py.utils import gs_utils
+from py.utils import url_utils
import buildbot_globals
import gm_json
diff --git a/gm/rebaseline_server/download_actuals_test.py b/gm/rebaseline_server/download_actuals_test.py
index c405a3cf57..a74389f459 100755
--- a/gm/rebaseline_server/download_actuals_test.py
+++ b/gm/rebaseline_server/download_actuals_test.py
@@ -20,13 +20,12 @@ within self._output_dir_expected, which wouldn't be good...
# System-level imports
import os
-import shutil
-import tempfile
-import urllib
+
+# Must fix up PYTHONPATH before importing from within Skia
+import fix_pythonpath # pylint: disable=W0611
# Imports from within Skia
-import fix_pythonpath # must do this first
-from pyutils import url_utils
+from py.utils import url_utils
import base_unittest
import download_actuals
diff --git a/gm/rebaseline_server/fix_pythonpath.py b/gm/rebaseline_server/fix_pythonpath.py
index ed578ced10..cc32f4a6bc 100755
--- a/gm/rebaseline_server/fix_pythonpath.py
+++ b/gm/rebaseline_server/fix_pythonpath.py
@@ -6,16 +6,15 @@ Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-Adds [trunk]/gm and [trunk]/tools to PYTHONPATH, if they aren't already there.
+Adds possibly-needed directories to PYTHONPATH, if they aren't already there.
"""
import os
import sys
-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)
+TRUNK_DIRECTORY = os.path.abspath(os.path.join(
+ os.path.dirname(__file__), os.pardir, os.pardir))
+for subdir in ['common', 'gm', 'tools']:
+ fullpath = os.path.join(TRUNK_DIRECTORY, subdir)
+ if fullpath not in sys.path:
+ sys.path.append(fullpath)
diff --git a/gm/rebaseline_server/results.py b/gm/rebaseline_server/results.py
index 8e6bc436d1..da970af3c7 100755
--- a/gm/rebaseline_server/results.py
+++ b/gm/rebaseline_server/results.py
@@ -15,9 +15,7 @@ import os
import re
# Must fix up PYTHONPATH before importing from within Skia
-# pylint: disable=W0611
-import fix_pythonpath
-# pylint: enable=W0611
+import fix_pythonpath # pylint: disable=W0611
# Imports from within Skia
import gm_json
diff --git a/gm/rebaseline_server/server.py b/gm/rebaseline_server/server.py
index e82ecf2049..418f5dd51f 100755
--- a/gm/rebaseline_server/server.py
+++ b/gm/rebaseline_server/server.py
@@ -26,12 +26,10 @@ import time
import urlparse
# Must fix up PYTHONPATH before importing from within Skia
-# pylint: disable=W0611
-import fix_pythonpath
-# pylint: enable=W0611
+import fix_pythonpath # pylint: disable=W0611
# Imports from within Skia
-from pyutils import gs_utils
+from py.utils import gs_utils
import gm_json
# Imports from local dir