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

Unified Diff: tools/rebaseline.py

Issue 23478011: rebaseline.py: add --bugs and --unreviewed flags (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add_flags Created 7 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: tools/rebaseline.py
===================================================================
--- tools/rebaseline.py (revision 11009)
+++ tools/rebaseline.py (working copy)
@@ -160,10 +160,17 @@
# rebaseline whatever configs the JSON results summary file tells
# us to
# add_new: if True, add expectations for tests which don't have any yet
+ # bugs: optional list of bug numbers which pertain to these expectations
+ # mark_unreviewed: if True, mark these expectations as NOT having been
+ # reviewed by a human; otherwise, leave that field blank.
+ # Currently, there is no way to make this script mark
+ # expectations as reviewed-by-human=True.
+ # TODO(epoger): Add that capability to a review tool.
def __init__(self, expectations_root, expectations_input_filename,
expectations_output_filename, actuals_base_url,
actuals_filename, exception_handler,
- tests=None, configs=None, add_new=False):
+ tests=None, configs=None, add_new=False, bugs=None,
+ mark_unreviewed=None):
self._expectations_root = expectations_root
self._expectations_input_filename = expectations_input_filename
self._expectations_output_filename = expectations_output_filename
@@ -173,6 +180,8 @@
self._actuals_filename = actuals_filename
self._exception_handler = exception_handler
self._add_new = add_new
+ self._bugs = bugs
+ self._mark_unreviewed = mark_unreviewed
self._image_filename_re = re.compile(gm_json.IMAGE_FILENAME_PATTERN)
self._using_svn = os.path.isdir(os.path.join(expectations_root, '.svn'))
@@ -280,6 +289,12 @@
expected_results[image_name] = {}
expected_results[image_name][gm_json.JSONKEY_EXPECTEDRESULTS_ALLOWEDDIGESTS] = \
[image_results]
+ if self._mark_unreviewed:
epoger 2013/08/29 19:45:31 Patchset 2 adds the --bugs and --unreviewed flags,
+ expected_results[image_name][gm_json.JSONKEY_EXPECTEDRESULTS_REVIEWED] = \
+ False
+ if self._bugs:
+ expected_results[image_name][gm_json.JSONKEY_EXPECTEDRESULTS_BUGS] = \
+ self._bugs
# Write out updated expectations.
expectations_output_filepath = os.path.join(
@@ -310,6 +325,10 @@
'updating expectations for failing tests, add ' +
'expectations for tests which don\'t have expectations ' +
'yet.')
+parser.add_argument('--bugs', metavar='BUG', type=int, nargs='+',
+ help='Skia bug numbers (under ' +
+ 'https://code.google.com/p/skia/issues/list ) which '+
+ 'pertain to this set of rebaselines.')
parser.add_argument('--builders', metavar='BUILDER', nargs='+',
help='which platforms to rebaseline; ' +
'if unspecified, rebaseline all platforms, same as ' +
@@ -347,6 +366,9 @@
'"--tests aaclip bigmatrix", as a filter over the full ' +
'set of results in ACTUALS_FILENAME; if unspecified, ' +
'rebaseline *all* tests that are available.')
+parser.add_argument('--unreviewed', action='store_true',
+ help='mark all expectations modified by this run as ' +
+ '"%s": False' % gm_json.JSONKEY_EXPECTEDRESULTS_REVIEWED)
args = parser.parse_args()
exception_handler = ExceptionHandler(
keep_going_on_failure=args.keep_going_on_failure)
@@ -374,7 +396,7 @@
actuals_base_url=args.actuals_base_url,
actuals_filename=args.actuals_filename,
exception_handler=exception_handler,
- add_new=args.add_new)
+ add_new=args.add_new, bugs=args.bugs, mark_unreviewed=args.unreviewed)
try:
rebaseliner.RebaselineSubdir(builder=builder)
except BaseException as e:

Powered by Google App Engine
This is Rietveld 408576698