+2013-07-31 Bem Jones-Bey <bjonesbe@adobe.com>
+
+ Update location of w3c shapes tests to reflect new import location
+ https://bugs.webkit.org/show_bug.cgi?id=118156
+
+ Reviewed by Dirk Pranke.
+
+ Partial imports should not be imported to the same place as the full
+ import, so this adds an option to allow importing to a different
+ location than the default. In doing that, I found that imports from
+ contributor directories didn't seem to be working correctly, so I
+ updated the import to be smarter about both contributor directories
+ and the test status directories. It should now be more likely that the
+ script guesses the root directory properly.
+
+ * Scripts/webkitpy/w3c/test_importer.py: Remove comment about the
+ script not working with the full set of contributors, as that is
+ no longer true, and I didn't see a good way to keep that behavior.
+ Also update documentation to properly explain what happens when a
+ contributor dir is imported.
+ (main): Attempt to find the proper repo dir by looking at the
+ directory above the "test status" in the given path, this is still
+ not exactly right, but is less error prone than just trimming.
+ (parse_args): Add -d option to set the import directory.
+ (TestImporter.__init__): Stop appending the subdirs to the
+ destination_directory because it was making things more complex
+ and isn't really needed.
+ (TestImporter.update_test_status): Remove hardcoded strings and use
+ the TEST_STATUS constants instead.
+ * Scripts/webkitpy/w3c/test_importer_unittest.py:
+ (TestImporterTest.test_import_dir_with_no_tests_and_no_hg): Add
+ support for new option.
+ (TestImporterTest.test_import_dir_with_no_tests): Ditto.
+
2013-07-31 Brent Fulgham <bfulgham@apple.com>
[Windows] Winlauncher shouldn't look for Safari Install Directory
mirrors the CSS Mercurial repo. For example, <csswg_repo_root>/approved/css2.1 is brought in
as LayoutTests/csswg/approved/css2.1, maintaining the entire directory structure under that
- - If the tests are submitted, they'll be brought in as LayoutTests/csswg/submitted and will also
- maintain their directory structure under that. For example, everything under
- <csswg_repo_root>/contributors/adobe/submitted is brought into submitted, mirroring its
- directory structure in the csswg repo
+ - If the tests are submitted, they'll maintain their directory structure under
+ LayoutTests/csswg. For example, everything under
+ <csswg_repo_root>/contributors/adobe/submitted is brought into
+ LayoutTests/csswg/contributors/adobe/submitted, mirroring its directory structure in the
+ csswg repo
- If the import directory specified is just a contributor folder, only the submitted folder
for that contributor is brought in. For example, to import all of Mozilla's tests, either
<csswg_repo_root>/contributors/mozilla or <csswg_repo_root>/contributors/mozilla/submitted
- will work and are equivalent
-
- - For the time being, this script won't work if you try to import the full set of submitted
- tests under contributors/*/submitted. Since these are awaiting review, this is just a small
- control mechanism to enforce carefully selecting what non-approved tests are imported.
- It can obviously and easily be changed.
+ will work and are equivalent.
- By default, only reftests and jstest are imported. This can be overridden with a -a or --all
argument
TEST_STATUS_UNKNOWN = 'unknown'
TEST_STATUS_APPROVED = 'approved'
TEST_STATUS_SUBMITTED = 'submitted'
+VALID_TEST_STATUSES = [TEST_STATUS_APPROVED, TEST_STATUS_SUBMITTED]
+
+CONTRIBUTOR_DIR_NAME = 'contributors'
CHANGESET_NOT_AVAILABLE = 'Not Available'
options, args = parse_args()
import_dir = args[0]
if len(args) == 1:
- repo_dir = os.path.dirname(import_dir)
+ repo_dir_parts = []
+ for part in import_dir.split(os.path.sep):
+ if part in VALID_TEST_STATUSES:
+ break
+ else:
+ repo_dir_parts.append(part)
+ repo_dir = os.path.sep.join(repo_dir_parts)
else:
repo_dir = args[1]
help='Flag to prevent duplicate test files from overwriting existing tests. By default, they will be overwritten')
parser.add_option('-a', '--all', action='store_true', default=False,
help='Import all tests including reftests, JS tests, and manual/pixel tests. By default, only reftests and JS tests are imported')
+ parser.add_option('-d', '--dest-dir', dest='destination', default='w3c',
+ help='Import into a specified directory relative to the LayoutTests root. By default, imports into w3c')
options, args = parser.parse_args()
if len(args) not in (1, 2):
webkit_finder = WebKitFinder(self.filesystem)
self._webkit_root = webkit_finder.webkit_base()
self.repo_dir = repo_dir
- subdirs = os.path.dirname(os.path.relpath(source_directory, repo_dir))
- self.destination_directory = webkit_finder.path_from_webkit_base("LayoutTests", 'w3c', *subdirs)
+ self.destination_directory = webkit_finder.path_from_webkit_base("LayoutTests", options.destination)
self.changeset = CHANGESET_NOT_AVAILABLE
self.test_status = TEST_STATUS_UNKNOWN
status = TEST_STATUS_UNKNOWN
- if 'approved' in self.source_directory.split(os.path.sep):
- status = TEST_STATUS_APPROVED
- elif 'submitted' in self.source_directory.split(os.path.sep):
- status = TEST_STATUS_SUBMITTED
+ directory_parts = self.source_directory.split(os.path.sep)
+ for test_status in VALID_TEST_STATUSES:
+ if test_status in directory_parts:
+ status = test_status
self.test_status = status
host.executive = MockExecutive2(exception=OSError())
host.filesystem = MockFileSystem(files=FAKE_FILES)
- importer = TestImporter(host, FAKE_SOURCE_DIR, FAKE_REPO_DIR, optparse.Values({"overwrite": False}))
+ importer = TestImporter(host, FAKE_SOURCE_DIR, FAKE_REPO_DIR, optparse.Values({"overwrite": False, 'destination': 'w3c'}))
oc = OutputCapture()
oc.capture_output()
host.executive = MockExecutive2(exception=ScriptError("abort: no repository found in '/Volumes/Source/src/wk/Tools/Scripts/webkitpy/w3c' (.hg not found)!"))
host.filesystem = MockFileSystem(files=FAKE_FILES)
- importer = TestImporter(host, FAKE_SOURCE_DIR, FAKE_REPO_DIR, optparse.Values({"overwrite": False}))
+ importer = TestImporter(host, FAKE_SOURCE_DIR, FAKE_REPO_DIR, optparse.Values({"overwrite": False, 'destination': 'w3c'}))
oc = OutputCapture()
oc.capture_output()
try: