OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 | 6 |
7 from webkitpy.w3c.local_wpt import LocalWPT | 7 from webkitpy.w3c.local_wpt import LocalWPT |
8 from webkitpy.w3c.chromium_commit import ChromiumCommit | 8 from webkitpy.w3c.chromium_commit import ChromiumCommit |
9 | 9 |
10 _log = logging.getLogger(__name__) | 10 _log = logging.getLogger(__name__) |
11 | 11 |
12 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/external/wpt/' | 12 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/external/wpt/' |
13 | 13 |
14 | 14 |
15 class TestExporter(object): | 15 class TestExporter(object): |
16 | 16 |
17 def __init__(self, host, wpt_github, dry_run=False): | 17 def __init__(self, host, wpt_github, dry_run=False): |
18 self.host = host | 18 self.host = host |
19 self.wpt_github = wpt_github | 19 self.wpt_github = wpt_github |
20 self.dry_run = dry_run | 20 self.dry_run = dry_run |
21 self.local_wpt = LocalWPT(self.host) | 21 self.local_wpt = LocalWPT(self.host) |
| 22 self.local_wpt.fetch() |
22 | 23 |
23 def run(self): | 24 def run(self): |
24 """Query in-flight pull requests, then merge PR or create one. | 25 """Query in-flight pull requests, then merge PR or create one. |
25 | 26 |
26 This script assumes it will be run on a regular interval. On | 27 This script assumes it will be run on a regular interval. On |
27 each invocation, it will either attempt to merge or attempt to | 28 each invocation, it will either attempt to merge or attempt to |
28 create a PR, never both. | 29 create a PR, never both. |
29 """ | 30 """ |
30 pull_requests = self.wpt_github.in_flight_pull_requests() | 31 pull_requests = self.wpt_github.in_flight_pull_requests() |
31 | 32 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 def is_exportable(chromium_commit): | 136 def is_exportable(chromium_commit): |
136 patch = chromium_commit.format_patch() | 137 patch = chromium_commit.format_patch() |
137 return ( | 138 return ( |
138 patch | 139 patch |
139 and self.local_wpt.test_patch(patch) | 140 and self.local_wpt.test_patch(patch) |
140 and 'NOEXPORT=true' not in chromium_commit.message() | 141 and 'NOEXPORT=true' not in chromium_commit.message() |
141 and not chromium_commit.message().startswith('Import ') | 142 and not chromium_commit.message().startswith('Import ') |
142 ) | 143 ) |
143 | 144 |
144 return [c for c in chromium_commits if is_exportable(c)] | 145 return [c for c in chromium_commits if is_exportable(c)] |
OLD | NEW |