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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

Issue 2644783003: Regenerate MANIFEST.json when WPT tests are run (Closed)
Patch Set: wip - work on what we discussed in the bug Created 3 years, 10 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/layout_tests/controllers/manager.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
index dc1ece7d3ec7c2bb39cf0bf582c52f95199b44a8..beaee47c89600fc1fa35be5727d1773380da83e5 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
@@ -44,6 +44,7 @@ import sys
import time
from webkitpy.common.net.file_uploader import FileUploader
+from webkitpy.common.webkit_finder import WebKitFinder
from webkitpy.layout_tests.controllers.layout_test_finder import LayoutTestFinder
from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunner
from webkitpy.layout_tests.controllers.test_result_writer import TestResultWriter
@@ -71,6 +72,7 @@ class Manager(object):
printer: A Printer object to record updates to.
"""
self._port = port
+ self._executive = port.host.executive
self._filesystem = port.host.filesystem
self._options = options
self._printer = printer
@@ -88,6 +90,7 @@ class Manager(object):
self._results_directory = self._port.results_directory()
self._finder = LayoutTestFinder(self._port, self._options)
+ self._webkit_finder = WebKitFinder(port.host.filesystem)
self._runner = LayoutTestRunner(self._options, self._port, self._printer, self._results_directory, self._test_is_slow)
def run(self, args):
@@ -95,6 +98,22 @@ class Manager(object):
start_time = time.time()
self._printer.write_update("Collecting tests ...")
running_all_tests = False
+
+ # TODO(jeffcarp): unit test
+ # if self._will_run_wpt_tests():
+ # Conundrum: MANIFEST.json needs to be generated before we find tests,
+ # but to know if we need to generate MANIFEST.json we need to find tests...
jeffcarp 2017/02/21 19:32:11 I need the most help here figuring out if there's
qyearsley 2017/02/21 22:47:57 Always regenerating it seems like a reasonable opt
foolip 2017/02/23 02:51:30 On some systems I think the mtime of LayoutTests/e
+
+ manifest_base_path = self._webkit_finder.path_from_webkit_base(
+ 'LayoutTests', 'external', 'WPT_BASE_MANIFEST.json')
+ manifest_path = self._webkit_finder.path_from_webkit_base(
+ 'LayoutTests', 'external', 'wpt', 'MANIFEST.json')
+
+ if not self._filesystem.exists(manifest_path):
+ self._filesystem.copyfile(manifest_base_path, manifest_path)
+
+ self._generate_manifest()
+
try:
paths, all_test_names, running_all_tests = self._collect_tests(args)
except IOError:
@@ -545,3 +564,12 @@ class Manager(object):
for name, value in stats.iteritems():
json_results_generator.add_path_to_trie(name, value, stats_trie)
return stats_trie
+
+ def _generate_manifest(self):
+ self._printer.write_update('Generating MANIFEST.json for web-platform-tests ...')
+
+ wpt_path = self._webkit_finder.path_from_webkit_base('LayoutTests', 'external', 'wpt')
+ manifest_tool_path = self._webkit_finder.path_from_webkit_base(
+ 'Tools', 'Scripts', 'webkitpy', 'thirdparty', 'wpt', 'wpt', 'manifest')
+
+ self._executive.run_command(['python', manifest_tool_path, '--work', '--tests-root', wpt_path])

Powered by Google App Engine
This is Rietveld 408576698