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: |