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

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: Regenerate MANIFEST.json from template in run-webkit-tests 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..2b569cdf8cc79e4da9c61e129b19162b59d4cd9d 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,10 @@ class Manager(object):
start_time = time.time()
self._printer.write_update("Collecting tests ...")
running_all_tests = False
+
+ # Regenerate MANIFEST.json from template, necessary for WPT metadata
qyearsley 2017/02/28 18:54:45 Nit: period at end of comment. Could also spell ou
jeffcarp 2017/02/28 21:57:39 Done
+ self._ensure_manifest()
+
try:
paths, all_test_names, running_all_tests = self._collect_tests(args)
except IOError:
@@ -545,3 +552,19 @@ class Manager(object):
for name, value in stats.iteritems():
json_results_generator.add_path_to_trie(name, value, stats_trie)
return stats_trie
+
+ def _ensure_manifest(self):
qyearsley 2017/02/28 18:54:45 Do you think it makes sense to make this a public
jeffcarp 2017/02/28 21:57:39 My one reservation with that is that this method i
qyearsley 2017/02/28 22:04:31 Yep, follow-up CL would be fine, definitely.
+ manifest_path = self._webkit_finder.path_from_webkit_base(
+ 'LayoutTests', 'external', 'wpt', 'MANIFEST.json')
qyearsley 2017/02/28 18:54:45 Optional idea: These paths relative to webkit base
+ manifest_base_path = self._webkit_finder.path_from_webkit_base(
+ 'LayoutTests', 'external', 'WPT_BASE_MANIFEST.json')
qyearsley 2017/02/28 18:54:44 Here we're assuming that WPT_BASE_MANIFEST.json al
jeffcarp 2017/02/28 21:57:39 I think it's OK to assume it always exists because
qyearsley 2017/02/28 22:04:31 Alright; optionally you could still add an assert
+
+ if not self._filesystem.exists(manifest_path):
+ self._filesystem.copyfile(manifest_base_path, manifest_path)
+
+ manifest_tool_path = self._webkit_finder.path_from_webkit_base(
+ 'Tools', 'Scripts', 'webkitpy', 'thirdparty', 'wpt', 'wpt', 'manifest')
+ wpt_path = self._webkit_finder.path_from_webkit_base('LayoutTests', 'external', 'wpt')
+
+ self._printer.write_update('Generating MANIFEST.json for web-platform-tests ...')
+ self._executive.run_command(['python', manifest_tool_path, '--work', '--tests-root', wpt_path])

Powered by Google App Engine
This is Rietveld 408576698