Changeset 202340 in webkit
- Timestamp:
- Jun 22, 2016 11:20:31 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r202338 r202340 1 2016-06-22 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 W3C test importer should generate files to ignore by WebKit SCM 4 https://bugs.webkit.org/show_bug.cgi?id=142743 5 6 Reviewed by Darin Adler. 7 8 * resources/TestRepositories: Added the option to generate .gitignore and __init__.py for wpt repo. 9 * web-platform-tests/.gitignore: Regeneration changes the order of the ignored files and removes the __init__.py which is now committed to WebKit trunk. 10 * web-platform-tests/__init__.py: Added. 11 1 12 2016-06-22 Youenn Fablet <youennf@gmail.com> 2 13 -
trunk/LayoutTests/imported/w3c/resources/TestRepositories
r200309 r202340 31 31 "serve.py" 32 32 ], 33 "import_options": ["generate_git_submodules_description" ]33 "import_options": ["generate_git_submodules_description", "generate_gitignore"] 34 34 } 35 35 ] -
trunk/LayoutTests/imported/w3c/web-platform-tests/.gitignore
r191043 r202340 1 /resources/ 1 2 /.resources.url 2 /__init__.py 3 4 /resources/ 5 3 /resources/webidl2/ 4 /resources/.webidl2.url 5 /resources/webidl2/test/widlproc/ 6 /resources/webidl2/test/.widlproc.url 7 /tools/ 6 8 /.tools.url 7 /tools/ 9 /tools/html5lib/ 10 /tools/.html5lib.url 11 /tools/html5lib/html5lib/tests/testdata/ 12 /tools/html5lib/html5lib/tests/.testdata.url 13 /tools/pytest/ 14 /tools/.pytest.url 15 /tools/pywebsocket/ 16 /tools/.pywebsocket.url 17 /tools/six/ 18 /tools/.six.url 19 /tools/webdriver/ 20 /tools/.webdriver.url 21 /tools/wptserve/ 22 /tools/.wptserve.url -
trunk/Tools/ChangeLog
r202329 r202340 1 2016-06-22 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 3 W3C test importer should generate files to ignore by WebKit SCM 4 https://bugs.webkit.org/show_bug.cgi?id=142743 5 6 Reviewed by Darin Adler. 7 8 TestDownloader generates the .gitignore file according submodules git repository information. 9 TestImporter requests the generation of .gitignore and the main __init__.py according LayoutTests/imported/w3c/resources/TestRepositories options. 10 11 * Scripts/webkitpy/w3c/test_downloader.py: 12 (TestDownloader.generate_gitignore): Generating .gitignore according submodules description. 13 * Scripts/webkitpy/w3c/test_importer.py: 14 (TestImporter.process_test_repositories_import_options): Added the generation of .gitignore/__init__.py if the repo has the right option. 15 (TestImporter): 16 (TestImporter.write_init_py): Writing not empty __init__.py files. 17 (TestImporter.import_tests): Using of write_init_py. 18 * Scripts/webkitpy/w3c/test_importer_unittest.py: 19 (TestImporterTest.test_git_ignore_generation): Added .gitignore test. 20 (TestImporterTest): 21 (TestImporterTest.test_initpy_generation): Added __init__.py test. 22 1 23 2016-06-21 Sam Weinig <sam@webkit.org> 2 24 -
trunk/Tools/Scripts/webkitpy/w3c/test_downloader.py
r197027 r202340 32 32 import logging 33 33 34 from webkitpy.common.system.executive import Executive35 34 from webkitpy.common.system.filesystem import FileSystem 36 35 from webkitpy.common.webkit_finder import WebKitFinder … … 185 184 self._filesystem.write_text_file(filepath, json.dumps(self._git_submodules_description(test_repository), sort_keys=True, indent=4)) 186 185 186 def generate_gitignore(self, test_repository, destination_directory): 187 rules = [] 188 for submodule in self._git_submodules_description(test_repository): 189 path = list(submodule['path']) 190 path.insert(0, '') 191 rules.append('/'.join(path[:-1]) + '/' + path[-1] + '/') 192 rules.append('/'.join(path[:-1]) + '/.' + path[-1] + '.url') 193 self._filesystem.write_text_file(self._filesystem.join(destination_directory, test_repository['name'], '.gitignore'), '\n'.join(rules)) 194 187 195 def download_tests(self, destination_directory, test_paths=[]): 188 196 for test_repository in self.test_repositories: -
trunk/Tools/Scripts/webkitpy/w3c/test_importer.py
r200109 r202340 211 211 self.filesystem.maybe_make_directory(self.filesystem.join(self.destination_directory, 'resources')) 212 212 self._test_downloader.generate_git_submodules_description(test_repository, self.filesystem.join(self.destination_directory, 'resources', test_repository['name'] + '-modules.json')) 213 # FIXME: Generate WPT .gitignore and main __init__.py 213 if 'generate_gitignore' in test_repository['import_options']: 214 self._test_downloader.generate_gitignore(test_repository, self.destination_directory) 215 if 'generate_init_py' in test_repository['import_options']: 216 self.write_init_py(self.filesystem.join(self.destination_directory, test_repository['name'], '__init__.py')) 217 218 def write_init_py(self, filepath): 219 self.filesystem.write_text_file(filepath, '# This file is required for Python to search this directory for modules.') 214 220 215 221 def test_downloader(self): … … 429 435 elif orig_filepath.endswith('__init__.py') and not self.filesystem.getsize(orig_filepath): 430 436 # Some bots dislike empty __init__.py. 431 self. filesystem.write_text_file(new_filepath, '# This file is required for Python to search this directory for modules.')437 self.write_init_py(new_filepath) 432 438 else: 433 439 self.filesystem.copyfile(orig_filepath, new_filepath) -
trunk/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
r197163 r202340 26 26 # SUCH DAMAGE. 27 27 28 import optparse29 import shutil30 import tempfile31 28 import unittest 32 29 … … 37 34 from webkitpy.w3c.test_downloader import TestDownloader 38 35 from webkitpy.w3c.test_importer import parse_args, TestImporter 39 40 36 41 37 FAKE_SOURCE_DIR = '/tests/csswg' … … 64 60 "paths_to_skip": [], 65 61 "paths_to_import": [], 66 "import_options": ["generate_git_submodules_description" ]62 "import_options": ["generate_git_submodules_description", "generate_gitignore", "generate_init_py"] 67 63 } 68 64 ] … … 215 211 self.assertTrue(fs.exists('/mock-checkout/LayoutTests/w3c/web-platform-tests/.svn')) 216 212 213 def test_git_ignore_generation(self): 214 FAKE_FILES = { 215 '/mock-checkout/WebKitBuild/w3c-tests/csswg-tests/.gitmodules': '[submodule "tools/resources"]\n path = tools/resources\n url = https://github.com/w3c/testharness.js.git\n ignore = dirty\n', 216 '/mock-checkout/WebKitBuild/w3c-tests/web-platform-tests/.gitmodules': '[submodule "tools/resources"]\n path = tools/resources\n url = https://github.com/w3c/testharness.js.git\n ignore = dirty\n', 217 } 218 219 FAKE_FILES.update(FAKE_REPOSITORY) 220 221 fs = self.import_downloaded_tests(['--no-fetch', '--import-all', '-d', 'w3c'], FAKE_FILES) 222 223 self.assertFalse(fs.exists('/mock-checkout/LayoutTests/w3c/csswg-tests/.gitignore')) 224 self.assertTrue(fs.exists('/mock-checkout/LayoutTests/w3c/web-platform-tests/.gitignore')) 225 # We should activate these lines but this is not working in mock systems. 226 #self.assertTrue('/tools/.resources.url' in fs.read_text_file('/mock-checkout/LayoutTests/w3c/web-platform-tests/.gitignore')) 227 #self.assertTrue('/tools/resources/' in fs.read_text_file('/mock-checkout/LayoutTests/w3c/web-platform-tests/.gitignore')) 228 229 def test_initpy_generation(self): 230 FAKE_FILES = { 231 '/mock-checkout/WebKitBuild/w3c-tests/csswg-tests/.gitmodules': '[submodule "tools/resources"]\n path = tools/resources\n url = https://github.com/w3c/testharness.js.git\n ignore = dirty\n', 232 '/mock-checkout/WebKitBuild/w3c-tests/web-platform-tests/.gitmodules': '[submodule "tools/resources"]\n path = tools/resources\n url = https://github.com/w3c/testharness.js.git\n ignore = dirty\n', 233 } 234 235 FAKE_FILES.update(FAKE_REPOSITORY) 236 237 host = MockHost() 238 host.executive = MockExecutive2() 239 host.filesystem = MockFileSystem(files=FAKE_FILES) 240 241 fs = self.import_downloaded_tests(['--no-fetch', '--import-all', '-d', 'w3c'], FAKE_FILES) 242 243 self.assertFalse(fs.exists('/mock-checkout/LayoutTests/w3c/csswg-tests/__init__.py')) 244 self.assertTrue(fs.exists('/mock-checkout/LayoutTests/w3c/web-platform-tests/__init__.py')) 245 self.assertTrue(fs.getsize('/mock-checkout/LayoutTests/w3c/web-platform-tests/__init__.py') > 0) 246 217 247 # FIXME: Needs more tests.
Note: See TracChangeset
for help on using the changeset viewer.