subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1646230 - /subversion/trunk/subversion/tests/cmdline/svnsync_tests.py
Date Wed, 17 Dec 2014 13:12:07 GMT
Author: julianfoad
Date: Wed Dec 17 13:12:06 2014
New Revision: 1646230

URL: http://svn.apache.org/r1646230
Log:
In the svnsync tests, remove a load-and-dump cycle from the repository
comparison function.

The load-and-dump cycle was introduced in r1230676 to account for different
ordering of nodes in dumpfiles generated by different versions of
Subversion.

In r1292507 the test suite was changed to compare dumpfiles in parsed form,
to account for variable ordering of nodes produced by different runs of
Subversion. This makes the previous patch redundant.

Loading and dumping can change data in some cases -- for example 'load'
currently rewrites svn:mergeinfo -- and so could mask errors or cause errors
in certain tests. The current tests seem to be unaffected but it broke a
test that I am writing for issue #4476 "Mergeinfo containing r0 makes
svnsync and dump and load fail". That is not to say that comparing dumpfiles
in parsed form cannot also mask errors, but one procedure is better than
two.

* subversion/tests/cmdline/svnsync_tests.py
  (verify_mirror): Take the expected dump file contents directly instead
    of in a repository in a sandbox.
  (run_test,
   delete_revprops): Pass the expected dump file contents directly instead
    of in a repository in a sandbox.

Modified:
    subversion/trunk/subversion/tests/cmdline/svnsync_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnsync_tests.py?rev=1646230&r1=1646229&r2=1646230&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnsync_tests.py Wed Dec 17 13:12:06 2014
@@ -209,8 +209,12 @@ def setup_and_sync(sbox, dump_file_conte
 
   return dest_sbox
 
-def verify_mirror(dest_sbox, src_sbox):
-  """Compare the contents of the DEST_SBOX repository with EXP_DUMP_FILE_CONTENTS."""
+def verify_mirror(dest_sbox, exp_dump_file_contents):
+  """Compare the contents of the mirror repository in DEST_SBOX with
+     EXP_DUMP_FILE_CONTENTS, by comparing the parsed dump stream content.
+
+     First remove svnsync rev-props from the DEST_SBOX repository.
+  """
 
   # Remove some SVNSync-specific housekeeping properties from the
   # mirror repository in preparation for the comparison dump.
@@ -222,10 +226,9 @@ def verify_mirror(dest_sbox, src_sbox):
 
   # Create a dump file from the mirror repository.
   dest_dump = svntest.actions.run_and_verify_dump(dest_sbox.repo_dir)
-  src_dump = svntest.actions.run_and_verify_dump(src_sbox.repo_dir)
 
   svntest.verify.compare_dump_files(
-    "Dump files", "DUMP", src_dump, dest_dump)
+    "Dump files", "DUMP", exp_dump_file_contents, dest_dump)
 
 def run_test(sbox, dump_file_name, subdir=None, exp_dump_file_name=None,
              bypass_prop_validation=False, source_prop_encoding=None,
@@ -251,16 +254,12 @@ or another dump file."""
   # dump file (used to create the master repository) or another specified dump
   # file.
   if exp_dump_file_name:
-    build_repos(sbox)
-    svntest.actions.run_and_verify_load(sbox.repo_dir,
-                                        open(os.path.join(svnsync_tests_dir,
-                                                          exp_dump_file_name),
-                                             'rb').readlines())
-    src_sbox = sbox
+    exp_dump_file_contents = open(os.path.join(svnsync_tests_dir,
+                                  exp_dump_file_name), 'rb').readlines()
   else:
-    src_sbox = sbox
+    exp_dump_file_contents = master_dumpfile_contents
 
-  verify_mirror(dest_sbox, sbox)
+  verify_mirror(dest_sbox, exp_dump_file_contents)
 
 
 
@@ -564,9 +563,7 @@ def delete_revprops(sbox):
   run_copy_revprops(dest_sbox.repo_url, sbox.repo_url)
 
   # Does the result look as we expected?
-  build_repos(sbox)
-  svntest.actions.run_and_verify_load(sbox.repo_dir, expected_contents)
-  verify_mirror(dest_sbox, sbox)
+  verify_mirror(dest_sbox, expected_contents)
 
 @Issue(3870)
 @SkipUnless(svntest.main.is_posix_os)



Mime
View raw message