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

Unified Diff: Tools/Scripts/webkitpy/tool/commands/flakytests.py

Issue 312103005: Minor cleanups to flakytests.py (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address review comments Created 6 years, 6 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/Scripts/webkitpy/tool/commands/flakytests.py
diff --git a/Tools/Scripts/webkitpy/tool/commands/flakytests.py b/Tools/Scripts/webkitpy/tool/commands/flakytests.py
index 69f0390f5573350db5e1c68498b69418fe5d8d43..936eee908217cd9cd0761225d312bce25be256ec 100644
--- a/Tools/Scripts/webkitpy/tool/commands/flakytests.py
+++ b/Tools/Scripts/webkitpy/tool/commands/flakytests.py
@@ -45,6 +45,17 @@ class FlakyTests(AbstractDeclarativeCommand):
'eseidel@chromium.org',
]
+ COMMIT_MESSAGE = (
+ 'Update FlakyTests to match current flakiness dashboard results\n\n'
+ 'Automatically generated using:\n'
+ 'webkit-patch update-flaky-tests\n\n'
+ 'R=%s\n')
+
+ FLAKY_TEST_CONTENTS = (
+ '# This file is generated by webkit-patch update-flaky-tests from the flakiness dashboard data.\n'
+ '# Manual changes will be overwritten.\n\n'
+ '%s\n')
+
def __init__(self):
options = [
optparse.make_option('--upload', action='store_true',
@@ -81,23 +92,12 @@ class FlakyTests(AbstractDeclarativeCommand):
print "No gardener, and --reviewers not specified, not bothering."
return 1
- commit_message = """Update FlakyTests to match current flakiness dashboard results
-
-Automatically generated using:
-webkit-patch update-flaky-tests
-
-R=%s
-""" % ','.join(reviewer_emails)
-
+ commit_message = self.COMMIT_MESSAGE % ','.join(reviewer_emails)
git_cmd = ['git', 'commit', '-m', commit_message,
tool.filesystem.join(tool.scm().checkout_root, flaky_tests_path)]
tool.executive.run_and_throw_if_fail(git_cmd)
- # FIXME: There must be a cleaner way to avoid the editor!
- # Silence the editor.
- os.environ['EDITOR'] = 'true'
-
- git_cmd = ['git', 'cl', 'upload', '--send-mail',
+ git_cmd = ['git', 'cl', 'upload', '--send-mail', '-f',
'--cc', ','.join(self.ALWAYS_CC)]
tool.executive.run_and_throw_if_fail(git_cmd)
@@ -115,7 +115,8 @@ R=%s
# in existing TestExpectations. We could certainly load existing TestExpecations
# and filter accordingly, or update existing TestExpectations instead of FlakyTests.
flaky_tests_path = fs.join(port.layout_tests_dir(), 'FlakyTests')
- fs.write_text_file(flaky_tests_path, TestExpectations.list_to_string(lines))
+ flaky_tests_contents = self.FLAKY_TEST_CONTENTS % TestExpectations.list_to_string(lines)
+ fs.write_text_file(flaky_tests_path, flaky_tests_contents)
print "Updated %s" % flaky_tests_path
if options.upload:
« no previous file with comments | « Tools/Scripts/webkitpy/common/system/executive_mock.py ('k') | Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698