Bug 161578

Summary: W3C test importer should generate the list of resource files
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, glenn, mcatanzaro, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=161604
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

youenn fablet
Reported 2016-09-04 11:38:50 PDT
Following on bug 161307, W3C test importer should generate the list of resource files.
Attachments
Patch (48.51 KB, patch)
2016-09-04 11:45 PDT, youenn fablet
no flags
Patch (49.40 KB, patch)
2016-09-05 00:11 PDT, youenn fablet
no flags
Patch for landing (49.41 KB, patch)
2016-09-05 03:00 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2016-09-04 11:45:35 PDT
Ryosuke Niwa
Comment 2 2016-09-04 18:50:02 PDT
Comment on attachment 287918 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287918&action=review > Tools/Scripts/webkitpy/w3c/test_importer.py:473 > + if not self._already_identified_as_resource_file(resource_file_path): > + files.append(resource_file_path) > + should_update_json_file = True This would not catch the case when a resource file becomes a test. > Tools/Scripts/webkitpy/w3c/test_importer.py:484 > + for directory in self._test_resource_files["directories"]: > + if path.find(directory) != -1: > + return True > + return False This should just be: return any([path.find(directory) != -1 for directory in self._test_resource_files["directories"]])
youenn fablet
Comment 3 2016-09-05 00:11:10 PDT
youenn fablet
Comment 4 2016-09-05 00:14:22 PDT
Thanks for the review. > View in context: > https://bugs.webkit.org/attachment.cgi?id=287918&action=review > > > Tools/Scripts/webkitpy/w3c/test_importer.py:473 > > + if not self._already_identified_as_resource_file(resource_file_path): > > + files.append(resource_file_path) > > + should_update_json_file = True > > This would not catch the case when a resource file becomes a test. I added a FIXME for it. In the meantime, the plan is that on each full resync, the list of resource files will be fully regenerated. I also added generation of a warning for tests imported in "resources" folder. > > Tools/Scripts/webkitpy/w3c/test_importer.py:484 > > + for directory in self._test_resource_files["directories"]: > > + if path.find(directory) != -1: > > + return True > > + return False > > This should just be: > return any([path.find(directory) != -1 for directory in > self._test_resource_files["directories"]]) Done.
Ryosuke Niwa
Comment 5 2016-09-05 00:24:39 PDT
Comment on attachment 287936 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287936&action=review > Tools/Scripts/webkitpy/w3c/test_importer.py:475 > + resource_file_path = full_path.replace(self.source_directory, '')[1:] Presumably you're stripping the trailing / with [1:] but this is not robust nor is semantically descriptive. Use .rstrip('/') instead. An even better approach is to use self.filesystem.relpath.
youenn fablet
Comment 6 2016-09-05 03:00:55 PDT
Created attachment 287944 [details] Patch for landing
youenn fablet
Comment 7 2016-09-05 03:01:25 PDT
(In reply to comment #5) > Comment on attachment 287936 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=287936&action=review > > > Tools/Scripts/webkitpy/w3c/test_importer.py:475 > > + resource_file_path = full_path.replace(self.source_directory, '')[1:] > > Presumably you're stripping the trailing / with [1:] but this is not robust > nor is semantically descriptive. > Use .rstrip('/') instead. An even better approach is to use > self.filesystem.relpath. Done, thanks.
WebKit Commit Bot
Comment 8 2016-09-05 03:32:04 PDT
Comment on attachment 287944 [details] Patch for landing Clearing flags on attachment: 287944 Committed r205447: <http://trac.webkit.org/changeset/205447>
WebKit Commit Bot
Comment 9 2016-09-05 03:32:08 PDT
All reviewed patches have been landed. Closing bug.
Michael Catanzaro
Comment 10 2016-09-05 09:29:55 PDT
It broke a python test: [1432/1462] webkitpy.w3c.test_importer_unittest.TestImporterTest.test_clean_directory_option erred: Traceback (most recent call last): File "/home/slave/webkitgtk/gtk-linux-64-release-tests/build/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py", line 204, in test_clean_directory_option fs = self.import_downloaded_tests(['--no-fetch', '--import-all', '-d', 'w3c', '--clean-dest-dir'], FAKE_FILES) File "/home/slave/webkitgtk/gtk-linux-64-release-tests/build/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py", line 132, in import_downloaded_tests importer = TestImporter(host, None, options) File "/home/slave/webkitgtk/gtk-linux-64-release-tests/build/Tools/Scripts/webkitpy/w3c/test_importer.py", line 184, in __init__ self._test_resource_files["files"] = [] TypeError: 'NoneType' object does not support item assignment
youenn fablet
Comment 11 2016-09-05 09:32:03 PDT
This should be covered by bug 161604, let me know if you still see broken tests.
Note You need to log in before you can comment on or make changes to this bug.