Title: [232930] trunk/Tools
- Revision
- 232930
- Author
- [email protected]
- Date
- 2018-06-18 07:00:02 -0700 (Mon, 18 Jun 2018)
Log Message
[webkitpy] WPTRunner should remove any metadata content before (re)generating it
https://bugs.webkit.org/show_bug.cgi?id=186755
Reviewed by Carlos Garcia Campos.
WPTRunner generates the WPT-compliant metadata content before each test
run. Before it does so, it should remove the complete target directory
for this metadata, allowing any change in the expectations JSON to be
immediately reflected.
For example, if a test failure expectation is removed, the related .ini
metadata file is not generated anymore, but the stale .ini file isn't
removed from the current metadata directory. To avoid this, purging
the metadata directory and regenerating it from scratch should be done
for each test run.
* Scripts/webkitpy/w3c/wpt_runner.py:
(WPTRunner._generate_metadata_directory):
* Scripts/webkitpy/w3c/wpt_runner_unittest.py:
(WPTRunnerTest.test_generate_metadata_directory):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (232929 => 232930)
--- trunk/Tools/ChangeLog 2018-06-18 13:43:26 UTC (rev 232929)
+++ trunk/Tools/ChangeLog 2018-06-18 14:00:02 UTC (rev 232930)
@@ -1,3 +1,26 @@
+2018-06-18 Zan Dobersek <[email protected]>
+
+ [webkitpy] WPTRunner should remove any metadata content before (re)generating it
+ https://bugs.webkit.org/show_bug.cgi?id=186755
+
+ Reviewed by Carlos Garcia Campos.
+
+ WPTRunner generates the WPT-compliant metadata content before each test
+ run. Before it does so, it should remove the complete target directory
+ for this metadata, allowing any change in the expectations JSON to be
+ immediately reflected.
+
+ For example, if a test failure expectation is removed, the related .ini
+ metadata file is not generated anymore, but the stale .ini file isn't
+ removed from the current metadata directory. To avoid this, purging
+ the metadata directory and regenerating it from scratch should be done
+ for each test run.
+
+ * Scripts/webkitpy/w3c/wpt_runner.py:
+ (WPTRunner._generate_metadata_directory):
+ * Scripts/webkitpy/w3c/wpt_runner_unittest.py:
+ (WPTRunnerTest.test_generate_metadata_directory):
+
2018-06-12 Darin Adler <[email protected]>
[Cocoa] Make some RetainPtr refinements to get more ready for ARC
Modified: trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py (232929 => 232930)
--- trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py 2018-06-18 13:43:26 UTC (rev 232929)
+++ trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py 2018-06-18 14:00:02 UTC (rev 232930)
@@ -146,6 +146,8 @@
with self._host.filesystem.open_text_file_for_reading(expectations_file) as fd:
expectations = json.load(fd)
+ self._host.filesystem.rmtree(metadata_path)
+
for test_name, test_data in expectations.iteritems():
ini_file = self._host.filesystem.join(metadata_path, test_name + ".ini")
self._host.filesystem.maybe_make_directory(self._host.filesystem.dirname(ini_file))
Modified: trunk/Tools/Scripts/webkitpy/w3c/wpt_runner_unittest.py (232929 => 232930)
--- trunk/Tools/Scripts/webkitpy/w3c/wpt_runner_unittest.py 2018-06-18 13:43:26 UTC (rev 232929)
+++ trunk/Tools/Scripts/webkitpy/w3c/wpt_runner_unittest.py 2018-06-18 14:00:02 UTC (rev 232930)
@@ -191,7 +191,16 @@
"/mock-checkout/WebPlatformTests/MockPort/TestExpectations.json",
TEST_EXPECTATIONS_JSON_CONTENT)
+ # Specify a stale metadata file that should be removed before generation.
+ stale_metadata_file = "/mock-metadata/test/stale_metadata_file.html.ini"
+ instance.host.filesystem.write_text_file(
+ stale_metadata_file, "[This file should be removed during generation]")
+
self.assertTrue(instance.runner._generate_metadata_directory(metadata_path))
+
+ # Check that the stale metadata file was indeed removed.
+ self.assertFalse(instance.host.filesystem.exists(stale_metadata_file))
+
for path, content in EXPECTED_TEST_MANIFESTS.items():
manifest_path = instance.host.filesystem.join(metadata_path, path)
self.assertTrue(instance.host.filesystem.isfile(manifest_path))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes