OLD | NEW |
---|---|
1 # Copyright (c) 2011 Google Inc. All rights reserved. | 1 # Copyright (c) 2011 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 Automatically generated using: | 86 Automatically generated using: |
87 webkit-patch update-flaky-tests | 87 webkit-patch update-flaky-tests |
88 | 88 |
89 R=%s | 89 R=%s |
90 """ % ','.join(reviewer_emails) | 90 """ % ','.join(reviewer_emails) |
91 | 91 |
92 git_cmd = ['git', 'commit', '-m', commit_message, | 92 git_cmd = ['git', 'commit', '-m', commit_message, |
93 tool.filesystem.join(tool.scm().checkout_root, flaky_tests_path)] | 93 tool.filesystem.join(tool.scm().checkout_root, flaky_tests_path)] |
94 tool.executive.run_and_throw_if_fail(git_cmd) | 94 tool.executive.run_and_throw_if_fail(git_cmd) |
95 | 95 |
96 # FIXME: There must be a cleaner way to avoid the editor! | 96 git_cmd = ['git', 'cl', 'upload', '--send-mail', '-f', |
97 # Silence the editor. | |
98 os.environ['EDITOR'] = 'true' | |
99 | |
100 git_cmd = ['git', 'cl', 'upload', '--send-mail', | |
101 '--cc', ','.join(self.ALWAYS_CC)] | 97 '--cc', ','.join(self.ALWAYS_CC)] |
102 tool.executive.run_and_throw_if_fail(git_cmd) | 98 tool.executive.run_and_throw_if_fail(git_cmd) |
103 | 99 |
104 def execute(self, options, args, tool): | 100 def execute(self, options, args, tool): |
105 port = tool.port_factory.get() | 101 port = tool.port_factory.get() |
106 port_names = tool.port_factory.all_port_names() | 102 port_names = tool.port_factory.all_port_names() |
107 factory = self.expectations_factory() | 103 factory = self.expectations_factory() |
108 lines = self._collect_expectation_lines(port_names, factory) | 104 lines = self._collect_expectation_lines(port_names, factory) |
109 lines.sort(key=lambda line: line.path) | 105 lines.sort(key=lambda line: line.path) |
110 # Skip any tests which are mentioned in the dashboard but not in our che ckout: | 106 # Skip any tests which are mentioned in the dashboard but not in our che ckout: |
111 fs = tool.filesystem | 107 fs = tool.filesystem |
112 lines = filter(lambda line: fs.exists(fs.join(port.layout_tests_dir(), l ine.path)), lines) | 108 lines = filter(lambda line: fs.exists(fs.join(port.layout_tests_dir(), l ine.path)), lines) |
113 | 109 |
114 # Note: This includes all flaky tests from the dashboard, even ones ment ioned | 110 # Note: This includes all flaky tests from the dashboard, even ones ment ioned |
115 # in existing TestExpectations. We could certainly load existing TestExp ecations | 111 # in existing TestExpectations. We could certainly load existing TestExp ecations |
116 # and filter accordingly, or update existing TestExpectations instead of FlakyTests. | 112 # and filter accordingly, or update existing TestExpectations instead of FlakyTests. |
117 flaky_tests_path = fs.join(port.layout_tests_dir(), 'FlakyTests') | 113 flaky_tests_path = fs.join(port.layout_tests_dir(), 'FlakyTests') |
118 fs.write_text_file(flaky_tests_path, TestExpectations.list_to_string(lin es)) | 114 fs.write_text_file(flaky_tests_path, """# This file is generated by webk it-patch update-flaky-tests from the flakiness dashboard data. |
Dirk Pranke
2014/06/09 17:07:10
Nit: I think you can do
fs.write_text_file(flaky
| |
115 # Manual changes will be overwritten. | |
116 | |
117 %s | |
118 """ % TestExpectations.list_to_string(lines)) | |
119 print "Updated %s" % flaky_tests_path | 119 print "Updated %s" % flaky_tests_path |
120 | 120 |
121 if options.upload: | 121 if options.upload: |
122 return self._commit_and_upload(tool, options) | 122 return self._commit_and_upload(tool, options) |
123 | 123 |
OLD | NEW |