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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py

Issue 2644783003: Regenerate MANIFEST.json when WPT tests are run (Closed)
Patch Set: Redo patch to try to alleviate rebase problems Created 3 years, 11 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/port/base.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
index b739d1dc809046dc84a7a795d540023b9e047d67..2fdf11717b1a1bb7a1a99f0dc501d1dd6928997d 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -36,6 +36,7 @@ import difflib
import errno
import functools
import json
+import hashlib
import logging
import optparse
import re
@@ -739,8 +740,32 @@ class Port(object):
@memoized
def _wpt_manifest(self):
- path = self._filesystem.join(self.layout_tests_dir(), 'external', 'wpt', 'MANIFEST.json')
- return json.loads(self._filesystem.read_text_file(path))
+ manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external', 'wpt', 'MANIFEST.json')
+
+ original_hash = self._get_manifest_hash(manifest_path)
+ self._generate_manifest()
+ updated_hash = self._get_manifest_hash(manifest_path)
+
+ if original_hash != updated_hash:
+ _log.warning('MANIFEST.json has been updated to reflect changes in external/wpt!')
+
+ return json.loads(self._filesystem.read_text_file(manifest_path))
+
+ def _get_manifest_hash(self, manifest_path):
+ hash_context = hashlib.md5()
+
+ manifest_buffer = self._filesystem.read_binary_file(manifest_path)
+ assert manifest_buffer
+
+ hash_context.update(manifest_buffer)
+ return hash_context.hexdigest()
+
+ def _generate_manifest(self):
+ wpt_path = self._webkit_finder.path_from_webkit_base('LayoutTests', 'external', 'wpt')
+ manifest_path = self._webkit_finder.path_from_webkit_base(
+ 'Tools', 'Scripts', 'webkitpy', 'thirdparty', 'wpt', 'wpt', 'manifest')
+ _log.info('Generating MANIFEST.json')
+ self._executive.run_command([manifest_path, '--work', '--tests-root', wpt_path])
def _manifest_items_for_path(self, path_in_wpt):
"""Returns a manifest item for the given WPT path, or None if not found.

Powered by Google App Engine
This is Rietveld 408576698