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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py

Issue 2337183002: Add --help and --verbose options to update-w3c-test-expectations. (Closed)
Patch Set: Remove unrelated files, remove extra parse_args function and a couple logging statements Created 4 years, 3 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: third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py
index 903c4d72ebcecf1cb62ac592b2fe51e03e17799e..b9eac6027d77ce6451f12bb2c1e1ce265ced2869 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py
@@ -11,9 +11,9 @@ Specifically, this class fetches results from try bots for the current CL, and:
This is used as part of the w3c test auto-import process.
"""
+import argparse
import logging
-from webkitpy.common.net.buildbot import BuildBot, Build
from webkitpy.common.net.git_cl import GitCL
from webkitpy.common.net.rietveld import Rietveld
from webkitpy.common.webkit_finder import WebKitFinder
@@ -29,14 +29,25 @@ class W3CExpectationsLineAdder(object):
self.host.initialize_scm()
self.finder = WebKitFinder(self.host.filesystem)
- def run(self):
+ def run(self, args=None):
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('-v', '--verbose', action='store_true', help='More verbose logging.')
+ args = parser.parse_args(args)
+ log_level = logging.DEBUG if args.verbose else logging.INFO
+ logging.basicConfig(level=log_level, format='%(message)s')
+
issue_number = self.get_issue_number()
+ if issue_number == 'None':
+ _log.error('No issue on current branch.')
+ return 1
+
try_bots = self.get_try_bots()
rietveld = Rietveld(self.host.web)
try_jobs = rietveld.latest_try_jobs(issue_number, try_bots)
+ _log.debug('Latest try jobs: %r', try_jobs)
if not try_jobs:
- print 'No Try Job information was collected.'
+ _log.error('No try job information was collected.')
return 1
test_expectations = {}
@@ -255,6 +266,7 @@ class W3CExpectationsLineAdder(object):
Args:
line_list: A list of w3c test expectations lines.
"""
+ _log.debug('Lines to write to TestExpectations: %r', line_list)
port = self.host.port_factory.get()
expectations_file = port.path_to_generic_test_expectations_file()
comment_line = '# Tests added from W3C auto import bot'
@@ -295,6 +307,7 @@ class W3CExpectationsLineAdder(object):
"""
modified_files = self.host.executive.run_command(['git', 'diff', 'origin/master', '--name-only']).splitlines()
tests_to_rebaseline, tests_results = self.get_tests_to_rebaseline(modified_files, tests_results)
+ _log.debug('Tests to rebaseline: %r', tests_to_rebaseline)
if tests_to_rebaseline:
webkit_patch = self.host.filesystem.join(
self.finder.chromium_base(), self.finder.webkit_base(), self.finder.path_to_script('webkit-patch'))

Powered by Google App Engine
This is Rietveld 408576698