Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py (277088 => 277089)
--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py 2021-05-06 15:04:18 UTC (rev 277088)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py 2021-05-06 15:24:22 UTC (rev 277089)
@@ -59,7 +59,7 @@
from webkitpy.common.checkout.scm.scm import CheckoutNeedsUpdate, commit_error_handler, AuthenticationError
from webkitpy.common.checkout.scm.svn import SVN
-from webkitpy.test.markers import xfail
+from webkitpy.test.markers import slow, xfail
from webkitcorepy import OutputCapture
@@ -609,6 +609,7 @@
with TimezoneOverride('PST8PDT'):
return changelog_entry.replace('DATE_HERE', date.today().isoformat())
+ @slow
def test_svn_apply(self):
first_entry = """2009-10-26 Eric Seidel <[email protected]>
@@ -712,6 +713,7 @@
def tearDown(self):
SVNTestRepository.tear_down(self)
+ @slow
def test_detect_scm_system_relative_url(self):
scm = detect_scm_system(".")
# I wanted to assert that we got the right path, but there was some
@@ -718,6 +720,7 @@
# crazy magic with temp folder names that I couldn't figure out.
self.assertTrue(scm.checkout_root)
+ @slow
def test_create_patch_is_full_patch(self):
test_dir_path = os.path.join(self.svn_checkout_path, "test_dir2")
os.mkdir(test_dir_path)
@@ -746,10 +749,12 @@
"""
self.assertEqual(expected_patch_contents, actual_patch_contents)
+ @slow
def test_detection(self):
self.assertEqual(self.scm.display_name(), "svn")
self.assertEqual(self.scm.supports_local_commits(), False)
+ @slow
def test_apply_small_binary_patch(self):
patch_contents = """Index: test_file.swf
===================================================================
@@ -771,11 +776,13 @@
actual_contents = read_from_path("test_file.swf", encoding=None)
self.assertEqual(actual_contents, expected_contents)
+ @slow
def test_apply_svn_patch(self):
patch = self._create_patch(_svn_diff("-r5:4"))
self._setup_webkittools_scripts_symlink(self.scm)
Checkout(self.scm).apply_patch(patch)
+ @slow
def test_commit_logs(self):
# Commits have dates and usernames in them, so we can't just direct compare.
self.assertRegexpMatches(self.scm.last_svn_commit_log(), 'fourth commit')
@@ -786,6 +793,7 @@
commit_text = self.scm.commit_with_message("another test commit", username)
self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '6')
+ @slow
def test_commit_in_subdir(self, username=None):
write_into_file_at_path('test_dir/test_file3', 'more test content')
os.chdir("test_dir")
@@ -793,12 +801,15 @@
os.chdir("..")
self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '6')
+ @slow
def test_commit_text_parsing(self):
self._shared_test_commit_with_message()
+ @slow
def test_commit_with_username(self):
self._shared_test_commit_with_message("[email protected]")
+ @slow
def test_commit_without_authorization(self):
# FIXME: https://bugs.webkit.org/show_bug.cgi?id=111669
# This test ends up looking in the actal $HOME/.subversion for authorization,
@@ -808,6 +819,7 @@
self.scm.svn_server_realm = '<http://svn.example.com:80> Example'
self.assertRaises(AuthenticationError, self._shared_test_commit_with_message)
+ @slow
def test_has_authorization_for_realm_using_credentials_with_passtype(self):
credentials = """
K 8
@@ -826,6 +838,7 @@
"""
self.assertTrue(self._test_has_authorization_for_realm_using_credentials(SVN.svn_server_realm, credentials))
+ @slow
def test_has_authorization_for_realm_using_credentials_with_password(self):
credentials = """
K 15
@@ -856,6 +869,7 @@
os.rmdir(fake_home_dir)
return result
+ @slow
def test_not_have_authorization_for_realm_with_credentials_missing_password_and_passtype(self):
credentials = """
K 15
@@ -870,6 +884,7 @@
"""
self.assertFalse(self._test_has_authorization_for_realm_using_credentials(SVN.svn_server_realm, credentials))
+ @slow
def test_not_have_authorization_for_realm_when_missing_credentials_file(self):
fake_home_dir = tempfile.mkdtemp(suffix="fake_home_dir")
svn_config_dir_path = os.path.join(fake_home_dir, ".subversion")
@@ -878,47 +893,61 @@
os.rmdir(svn_config_dir_path)
os.rmdir(fake_home_dir)
+ @slow
def test_reverse_diff(self):
self._shared_test_reverse_diff()
+ @slow
def test_diff_for_revision(self):
self._shared_test_diff_for_revision()
+ @slow
def test_svn_apply_git_patch(self):
self._shared_test_svn_apply_git_patch()
+ @slow
def test_changed_files(self):
self._shared_test_changed_files()
+ @slow
def test_untracked_files(self):
self._shared_test_untracked_files(self.scm)
+ @slow
def test_discard_untracked_files(self):
self._shared_test_discard_untracked_files(self.scm)
+ @slow
def test_changed_files_for_revision(self):
self._shared_test_changed_files_for_revision()
+ @slow
def test_added_files(self):
self._shared_test_added_files()
+ @slow
def test_contents_at_revision(self):
self._shared_test_contents_at_revision()
+ @slow
def test_revisions_changing_file(self):
self._shared_test_revisions_changing_file()
+ @slow
def test_committer_email_for_revision(self):
self._shared_test_committer_email_for_revision()
+ @slow
def test_add_recursively(self):
self._shared_test_add_recursively()
+ @slow
def test_delete(self):
os.chdir(self.svn_checkout_path)
self.scm.delete("test_file")
self.assertIn("test_file", self.scm.deleted_files())
+ @slow
def test_delete_list(self):
os.chdir(self.svn_checkout_path)
self.scm.delete_list(["test_file", "test_file2"])
@@ -925,38 +954,48 @@
self.assertIn("test_file", self.scm.deleted_files())
self.assertIn("test_file2", self.scm.deleted_files())
+ @slow
def test_delete_recursively(self):
self._shared_test_delete_recursively()
+ @slow
def test_delete_recursively_or_not(self):
self._shared_test_delete_recursively_or_not()
+ @slow
def test_head_svn_revision(self):
self._shared_test_head_svn_revision()
+ @slow
def test_svn_revision(self):
self._shared_test_svn_revision(self.scm)
+ @slow
def test_svn_branch(self):
self._shared_test_svn_branch(self.scm)
+ @slow
def test_native_revision(self):
self.assertEqual(self.scm.head_svn_revision(), self.scm.native_revision('.'))
self.assertEqual(self.scm.native_revision('.'), '5')
+ @slow
def test_native_branch(self):
self.assertEqual(self.scm.native_branch('.'), 'trunk')
+ @slow
def test_propset_propget(self):
filepath = os.path.join(self.svn_checkout_path, "test_file")
self.scm.propset("svn:mime-type", "x-application/foo-bar", filepath)
self.assertEqual(b"x-application/foo-bar", self.scm.propget("svn:mime-type", filepath))
+ @slow
def test_show_head(self):
write_into_file_at_path("test_file", u"Hello!", "utf-8")
SVNTestRepository._svn_commit("fourth commit")
self.assertEqual(b"Hello!", self.scm.show_head('test_file'))
+ @slow
def test_show_head_binary(self):
data = ""
write_into_file_at_path("binary_file", data, encoding=None)
@@ -980,6 +1019,7 @@
if os.path.exists(self.bogus_dir):
shutil.rmtree(self.bogus_dir)
+ @slow
def test_diff_for_file_with_existing_bogus_dir(self):
self.clean_bogus_dir()
os.mkdir(self.bogus_dir)
@@ -987,11 +1027,13 @@
self.assertTrue(os.path.exists(self.bogus_dir))
shutil.rmtree(self.bogus_dir)
+ @slow
def test_diff_for_file_with_missing_bogus_dir(self):
self.clean_bogus_dir()
self.do_test_diff_for_file()
self.assertFalse(os.path.exists(self.bogus_dir))
+ @slow
def test_svn_lock(self):
if self.scm.svn_version() >= Version(1, 7):
# the following technique with .svn/lock then svn update doesn't work with subversion client 1.7 or later
@@ -1005,6 +1047,7 @@
self.assertFalse(os.path.exists(svn_root_lock_path))
run_command(['svn', 'update']) # Should succeed and not raise.
+ @slow
def test_exists(self):
self._shared_test_exists(self.scm, self.scm.commit_with_message)
@@ -1201,10 +1244,12 @@
SVNTestRepository.tear_down(self)
self._tear_down_git_checkout()
+ @slow
def test_detection(self):
self.assertEqual(self.scm.display_name(), "git")
self.assertEqual(self.scm.supports_local_commits(), True)
+ @slow
def test_read_git_config(self):
key = 'test.git-config'
value = 'git-config value'
@@ -1211,6 +1256,7 @@
run_command(['git', 'config', key, value])
self.assertEqual(self.scm.read_git_config(key), value)
+ @slow
def test_local_commits(self):
test_file = os.path.join(self.git_checkout_path, 'test_file')
write_into_file_at_path(test_file, 'foo')
@@ -1218,6 +1264,7 @@
self.assertEqual(len(self.scm.local_commits()), 1)
+ @slow
def test_discard_local_commits(self):
test_file = os.path.join(self.git_checkout_path, 'test_file')
write_into_file_at_path(test_file, 'foo')
@@ -1227,6 +1274,7 @@
self.scm.discard_local_commits()
self.assertEqual(len(self.scm.local_commits()), 0)
+ @slow
def test_delete_branch(self):
new_branch = 'foo'
@@ -1238,6 +1286,7 @@
self.assertNotRegexpMatches(run_command(['git', 'branch']), r'foo')
+ @slow
def test_remote_merge_base(self):
# Diff to merge-base should include working-copy changes,
# which the diff to svn_branch.. doesn't.
@@ -1251,6 +1300,7 @@
self.assertRegexpMatches(diff_to_merge_base, b'foo')
@xfail
+ @slow
def test_rebase_in_progress(self):
svn_test_file = os.path.join(self.svn_checkout_path, 'test_file')
write_into_file_at_path(svn_test_file, "svn_checkout")
@@ -1272,6 +1322,7 @@
# Make sure cleanup doesn't throw when no rebase is in progress.
self.scm.discard_working_directory_changes()
+ @slow
def test_commitish_parsing(self):
# Multiple revisions are cherry-picked.
self.assertEqual(len(self.scm.commit_ids_from_commitish_arguments(['HEAD~2'])), 1)
@@ -1280,6 +1331,7 @@
# ... is an invalid range specifier
self.assertRaises(ScriptError, self.scm.commit_ids_from_commitish_arguments, ['trunk...HEAD'])
+ @slow
def test_commitish_order(self):
commit_range = 'HEAD~3..HEAD'
@@ -1289,6 +1341,7 @@
self.assertEqual(actual_commits, expected_commits)
+ @slow
def test_apply_git_patch(self):
# We carefullly pick a diff which does not have a directory addition
# as currently svn-apply will error out when trying to remove directories
@@ -1297,11 +1350,13 @@
self._setup_webkittools_scripts_symlink(self.scm)
Checkout(self.scm).apply_patch(patch)
+ @slow
def test_commit_text_parsing(self):
write_into_file_at_path('test_file', 'more test content')
commit_text = self.scm.commit_with_message("another test commit")
self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '6')
+ @slow
def test_commit_with_message_working_copy_only(self):
write_into_file_at_path('test_file_commit1', 'more test content')
run_command(['git', 'add', 'test_file_commit1'])
@@ -1335,10 +1390,12 @@
self._local_commit('test_file_commit0', 'more test content', 'another test commit')
self._two_local_commits()
+ @slow
def test_revisions_changing_files_with_local_commit(self):
self._one_local_commit()
self.assertEqual(self.scm.revisions_changing_file('test_file_commit1'), [])
+ @slow
def test_commit_with_message(self):
self._one_local_commit_plus_working_copy_changes()
self.assertRaises(AmbiguousCommitError, self.scm.commit_with_message, "yet another test commit")
@@ -1349,6 +1406,7 @@
self.assertRegexpMatches(svn_log, r'test_file_commit2')
self.assertRegexpMatches(svn_log, r'test_file_commit1')
+ @slow
def test_commit_with_message_git_commit(self):
self._two_local_commits()
@@ -1359,6 +1417,7 @@
self.assertRegexpMatches(svn_log, r'test_file_commit1')
self.assertNotRegexpMatches(svn_log, r'test_file_commit2')
+ @slow
def test_commit_with_message_git_commit_range(self):
self._three_local_commits()
@@ -1370,6 +1429,7 @@
self.assertRegexpMatches(svn_log, r'test_file_commit1')
self.assertRegexpMatches(svn_log, r'test_file_commit2')
+ @slow
def test_commit_with_message_only_local_commit(self):
self._one_local_commit()
commit_text = self.scm.commit_with_message("another test commit")
@@ -1376,6 +1436,7 @@
svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
self.assertRegexpMatches(svn_log, r'test_file_commit1')
+ @slow
def test_commit_with_message_multiple_local_commits_and_working_copy(self):
self._two_local_commits()
write_into_file_at_path('test_file_commit1', 'working copy change')
@@ -1388,11 +1449,13 @@
self.assertRegexpMatches(svn_log, r'test_file_commit2')
self.assertRegexpMatches(svn_log, r'test_file_commit1')
+ @slow
def test_commit_with_message_git_commit_and_working_copy(self):
self._two_local_commits()
write_into_file_at_path('test_file_commit1', 'working copy change')
self.assertRaises(ScriptError, self.scm.commit_with_message, "another test commit", git_commit="HEAD^")
+ @slow
def test_commit_with_message_multiple_local_commits_always_squash(self):
run_command(['git', 'config', 'webkit-patch.commit-should-always-squash', 'true'])
self._two_local_commits()
@@ -1403,6 +1466,7 @@
self.assertRegexpMatches(svn_log, r'test_file_commit2')
self.assertRegexpMatches(svn_log, r'test_file_commit1')
+ @slow
def test_commit_with_message_multiple_local_commits(self):
self._two_local_commits()
self.assertRaises(AmbiguousCommitError, self.scm.commit_with_message, "yet another test commit")
@@ -1414,6 +1478,7 @@
self.assertRegexpMatches(svn_log, r'test_file_commit2')
self.assertRegexpMatches(svn_log, r'test_file_commit1')
+ @slow
def test_commit_with_message_not_synced(self):
run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
self._two_local_commits()
@@ -1427,6 +1492,7 @@
self.assertRegexpMatches(svn_log, r'test_file_commit2')
self.assertRegexpMatches(svn_log, r'test_file_commit1')
+ @slow
def test_commit_with_message_not_synced_with_conflict(self):
run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
self._local_commit('test_file2', 'asdf', 'asdf commit')
@@ -1434,23 +1500,29 @@
# There's a conflict between trunk and the test_file2 modification.
self.assertRaises(ScriptError, self.scm.commit_with_message, "another test commit", force_squash=True)
+ @slow
def test_upstream_branch(self):
run_command(['git', 'checkout', '-t', '-b', 'my-branch'])
run_command(['git', 'checkout', '-t', '-b', 'my-second-branch'])
self.assertEqual(self.scm._upstream_branch(), 'my-branch')
+ @slow
def test_remote_branch_ref(self):
self.assertEqual(self.scm.remote_branch_ref(), 'refs/remotes/trunk')
+ @slow
def test_reverse_diff(self):
self._shared_test_reverse_diff()
+ @slow
def test_diff_for_revision(self):
self._shared_test_diff_for_revision()
+ @slow
def test_svn_apply_git_patch(self):
self._shared_test_svn_apply_git_patch()
+ @slow
def test_create_patch_local_plus_working_copy(self):
self._one_local_commit_plus_working_copy_changes()
patch = self.scm.create_patch()
@@ -1457,6 +1529,7 @@
self.assertRegexpMatches(patch, b'test_file_commit1')
self.assertRegexpMatches(patch, b'test_file_commit2')
+ @slow
def test_create_patch(self):
self._one_local_commit_plus_working_copy_changes()
patch = self.scm.create_patch()
@@ -1464,6 +1537,7 @@
self.assertRegexpMatches(patch, b'test_file_commit1')
self.assertRegexpMatches(patch, b'Subversion Revision: 5')
+ @slow
def test_create_patch_after_merge(self):
run_command(['git', 'checkout', '-b', 'dummy-branch', 'trunk~3'])
self._one_local_commit()
@@ -1473,11 +1547,13 @@
self.assertRegexpMatches(patch, b'test_file_commit1')
self.assertRegexpMatches(patch, b'Subversion Revision: 5')
+ @slow
def test_create_patch_with_changed_files(self):
self._one_local_commit_plus_working_copy_changes()
patch = self.scm.create_patch(changed_files=['test_file_commit2'])
self.assertRegexpMatches(patch, b'test_file_commit2')
+ @slow
def test_create_patch_with_rm_and_changed_files(self):
self._one_local_commit_plus_working_copy_changes()
os.remove('test_file_commit1')
@@ -1485,6 +1561,7 @@
patch_with_changed_files = self.scm.create_patch(changed_files=['test_file_commit1', 'test_file_commit2'])
self.assertEqual(patch, patch_with_changed_files)
+ @slow
def test_create_patch_git_commit(self):
self._two_local_commits()
patch = self.scm.create_patch(git_commit="HEAD^")
@@ -1491,6 +1568,7 @@
self.assertRegexpMatches(patch, b'test_file_commit1')
self.assertNotRegexpMatches(patch, b'test_file_commit2')
+ @slow
def test_create_patch_git_commit_range(self):
self._three_local_commits()
patch = self.scm.create_patch(git_commit="HEAD~2..HEAD")
@@ -1498,6 +1576,7 @@
self.assertRegexpMatches(patch, b'test_file_commit2')
self.assertRegexpMatches(patch, b'test_file_commit1')
+ @slow
def test_create_patch_working_copy_only(self):
self._one_local_commit_plus_working_copy_changes()
patch = self.scm.create_patch(git_commit="HEAD....")
@@ -1504,6 +1583,7 @@
self.assertNotRegexpMatches(patch, b'test_file_commit1')
self.assertRegexpMatches(patch, b'test_file_commit2')
+ @slow
def test_create_patch_multiple_local_commits(self):
self._two_local_commits()
patch = self.scm.create_patch()
@@ -1510,6 +1590,7 @@
self.assertRegexpMatches(patch, b'test_file_commit2')
self.assertRegexpMatches(patch, b'test_file_commit1')
+ @slow
def test_create_patch_not_synced(self):
run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
self._two_local_commits()
@@ -1518,6 +1599,7 @@
self.assertRegexpMatches(patch, b'test_file_commit2')
self.assertRegexpMatches(patch, b'test_file_commit1')
+ @slow
def test_create_binary_patch(self):
# Create a git binary patch and check the contents.
test_file_name = 'binary_file'
@@ -1549,6 +1631,7 @@
self.assertRegexpMatches(patch_from_local_commit, b'\nliteral 0\n')
self.assertRegexpMatches(patch_from_local_commit, b'\nliteral 256\n')
+ @slow
def test_changed_files_local_plus_working_copy(self):
self._one_local_commit_plus_working_copy_changes()
files = self.scm.changed_files()
@@ -1574,6 +1657,7 @@
self.assertIn('test_file_commit1', files)
self.assertIn('test_file_commit2', files)
+ @slow
def test_changed_files_git_commit(self):
self._two_local_commits()
files = self.scm.changed_files(git_commit="HEAD^")
@@ -1580,6 +1664,7 @@
self.assertIn('test_file_commit1', files)
self.assertNotIn('test_file_commit2', files)
+ @slow
def test_changed_files_git_commit_range(self):
self._three_local_commits()
files = self.scm.changed_files(git_commit="HEAD~2..HEAD")
@@ -1587,6 +1672,7 @@
self.assertIn('test_file_commit1', files)
self.assertIn('test_file_commit2', files)
+ @slow
def test_changed_files_working_copy_only(self):
self._one_local_commit_plus_working_copy_changes()
files = self.scm.changed_files(git_commit="HEAD....")
@@ -1593,6 +1679,7 @@
self.assertNotIn('test_file_commit1', files)
self.assertIn('test_file_commit2', files)
+ @slow
def test_changed_files_multiple_local_commits(self):
self._two_local_commits()
files = self.scm.changed_files()
@@ -1599,6 +1686,7 @@
self.assertIn('test_file_commit2', files)
self.assertIn('test_file_commit1', files)
+ @slow
def test_changed_files_not_synced(self):
run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
self._two_local_commits()
@@ -1607,6 +1695,7 @@
self.assertIn('test_file_commit2', files)
self.assertIn('test_file_commit1', files)
+ @slow
def test_changed_files_not_synced(self):
run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
self._two_local_commits()
@@ -1615,12 +1704,15 @@
self.assertIn('test_file_commit2', files)
self.assertIn('test_file_commit1', files)
+ @slow
def test_changed_files(self):
self._shared_test_changed_files()
+ @slow
def test_changed_files_for_revision(self):
self._shared_test_changed_files_for_revision()
+ @slow
def test_changed_files_upstream(self):
run_command(['git', 'checkout', '-t', '-b', 'my-branch'])
self._one_local_commit()
@@ -1641,26 +1733,33 @@
self.assertIn('test_file_commit2', files)
self.assertIn('test_file_commit0', files)
+ @slow
def test_contents_at_revision(self):
self._shared_test_contents_at_revision()
+ @slow
def test_revisions_changing_file(self):
self._shared_test_revisions_changing_file()
+ @slow
def test_added_files(self):
self._shared_test_added_files()
+ @slow
def test_committer_email_for_revision(self):
self._shared_test_committer_email_for_revision()
+ @slow
def test_add_recursively(self):
self._shared_test_add_recursively()
+ @slow
def test_delete(self):
self._two_local_commits()
self.scm.delete('test_file_commit1')
self.assertIn("test_file_commit1", self.scm.deleted_files())
+ @slow
def test_delete_list(self):
self._two_local_commits()
self.scm.delete_list(["test_file_commit1", "test_file_commit2"])
@@ -1667,31 +1766,39 @@
self.assertIn("test_file_commit1", self.scm.deleted_files())
self.assertIn("test_file_commit2", self.scm.deleted_files())
+ @slow
def test_delete_recursively(self):
self._shared_test_delete_recursively()
+ @slow
def test_delete_recursively_or_not(self):
self._shared_test_delete_recursively_or_not()
+ @slow
def test_head_svn_revision(self):
self._shared_test_head_svn_revision()
+ @slow
def test_native_revision(self):
command = ['git', '-C', self.git_checkout_path, 'rev-parse', 'HEAD']
self.assertEqual(self.scm.native_revision(self.git_checkout_path), run_command(command).strip())
+ @slow
def test_native_branch(self):
self.assertEqual('trunk', self.scm.native_branch(self.git_checkout_path))
+ @slow
def test_to_object_name(self):
relpath = 'test_file_commit1'
fullpath = os.path.realpath(os.path.join(self.git_checkout_path, relpath))
self.assertEqual(relpath, self.scm.to_object_name(fullpath))
+ @slow
def test_show_head(self):
self._two_local_commits()
self.assertEqual(b"more test content", self.scm.show_head('test_file_commit1'))
+ @slow
def test_show_head_binary(self):
self._two_local_commits()
data = ""
@@ -1700,6 +1807,7 @@
self.scm.commit_locally_with_message("a test commit")
self.assertEqual(data, self.scm.show_head('binary_file'))
+ @slow
def test_diff_for_file(self):
self._two_local_commits()
write_into_file_at_path('test_file_commit1', b"Updated", encoding=None)
@@ -1715,6 +1823,7 @@
self.assertIn("+Updated", cached_diff)
self.assertIn("-more test content", cached_diff)
+ @slow
def test_exists(self):
self._shared_test_exists(self.scm, self.scm.commit_locally_with_message)