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

Unified Diff: gm/rebaseline_server/results.py

Issue 474813002: rebaseline_server: include setA/setB descriptions in output JSON (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use posixpath.join() 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
« no previous file with comments | « gm/rebaseline_server/compare_to_expectations.py ('k') | gm/rebaseline_server/server.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/results.py
diff --git a/gm/rebaseline_server/results.py b/gm/rebaseline_server/results.py
index 347666a3b5760bb64cfc8a469b61ac386fa80626..b577a9295514752614aa1921fc9a3ce0eab0b013 100755
--- a/gm/rebaseline_server/results.py
+++ b/gm/rebaseline_server/results.py
@@ -23,7 +23,7 @@ import imagepairset
# Keys used to link an image to a particular GM test.
# NOTE: Keep these in sync with static/constants.js
-VALUE__HEADER__SCHEMA_VERSION = 4
+VALUE__HEADER__SCHEMA_VERSION = 5
KEY__EXPECTATIONS__BUGS = gm_json.JSONKEY_EXPECTEDRESULTS_BUGS
KEY__EXPECTATIONS__IGNOREFAILURE = gm_json.JSONKEY_EXPECTEDRESULTS_IGNOREFAILURE
KEY__EXPECTATIONS__REVIEWED = gm_json.JSONKEY_EXPECTEDRESULTS_REVIEWED
@@ -38,6 +38,8 @@ KEY__HEADER__IS_STILL_LOADING = 'resultsStillLoading'
KEY__HEADER__RESULTS_ALL = 'all'
KEY__HEADER__RESULTS_FAILURES = 'failures'
KEY__HEADER__SCHEMA_VERSION = 'schemaVersion'
+KEY__HEADER__SET_A_DESCRIPTIONS = 'setA'
+KEY__HEADER__SET_B_DESCRIPTIONS = 'setB'
KEY__HEADER__TIME_NEXT_UPDATE_AVAILABLE = 'timeNextUpdateAvailable'
KEY__HEADER__TIME_UPDATED = 'timeUpdated'
KEY__HEADER__TYPE = 'type'
@@ -45,6 +47,9 @@ KEY__RESULT_TYPE__FAILED = gm_json.JSONKEY_ACTUALRESULTS_FAILED
KEY__RESULT_TYPE__FAILUREIGNORED = gm_json.JSONKEY_ACTUALRESULTS_FAILUREIGNORED
KEY__RESULT_TYPE__NOCOMPARISON = gm_json.JSONKEY_ACTUALRESULTS_NOCOMPARISON
KEY__RESULT_TYPE__SUCCEEDED = gm_json.JSONKEY_ACTUALRESULTS_SUCCEEDED
+KEY__SET_DESCRIPTIONS__DIR = 'dir'
+KEY__SET_DESCRIPTIONS__REPO_REVISION = 'repoRevision'
+KEY__SET_DESCRIPTIONS__SECTION = 'section'
IMAGE_FILENAME_RE = re.compile(gm_json.IMAGE_FILENAME_PATTERN)
IMAGE_FILENAME_FORMATTER = '%s_%s.png' # pass in (testname, config)
@@ -68,6 +73,11 @@ class BaseComparisons(object):
"""Base class for generating summary of comparisons between two image sets.
"""
+ def __init__(self):
+ """Base constructor; most subclasses will override."""
+ self._setA_descriptions = None
+ self._setB_descriptions = None
+
def get_results_of_type(self, results_type):
"""Return results of some/all tests (depending on 'results_type' parameter).
@@ -94,7 +104,7 @@ class BaseComparisons(object):
"""
response_dict = self._results[results_type]
time_updated = self.get_timestamp()
- response_dict[imagepairset.KEY__ROOT__HEADER] = {
+ header_dict = {
KEY__HEADER__SCHEMA_VERSION: (
VALUE__HEADER__SCHEMA_VERSION),
@@ -119,6 +129,11 @@ class BaseComparisons(object):
# Whether the service is accessible from other hosts.
KEY__HEADER__IS_EXPORTED: is_exported,
}
+ if self._setA_descriptions:
+ header_dict[KEY__HEADER__SET_A_DESCRIPTIONS] = self._setA_descriptions
+ if self._setB_descriptions:
+ header_dict[KEY__HEADER__SET_B_DESCRIPTIONS] = self._setB_descriptions
+ response_dict[imagepairset.KEY__ROOT__HEADER] = header_dict
return response_dict
def get_timestamp(self):
« no previous file with comments | « gm/rebaseline_server/compare_to_expectations.py ('k') | gm/rebaseline_server/server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698