Author: hwright
Date: Thu Jan 12 18:06:45 2012
New Revision: 1230676
URL: http://svn.apache.org/viewvc?rev=1230676&view=rev
Log:
When comparing output from svnsync tests, use the same binary which generated
the dump output to generate the dump from the target repo.
Because the dump format is not unique (nodes may appear in a somewhat arbitrary
order), dump files produced by prior versions of Subversion, while still
correct, may not compare correctly when compared line-wise. In some cases,
this adds a bit of a performance penalty to the tests, but is more correct.
* subversion/tests/cmdline/svnsync_tests.py
(verify_mirror): Verify to sandboxes, rather than a sandbox against expected
dumpfile contents.
(run_test): Use the two existing sandboxes for comparison, or create a new
one if a specific dumpfile is required.
(delete_revprops): Create a sandbox to compare against.
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=1230676&r1=1230675&r2=1230676&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnsync_tests.py Thu Jan 12
18:06:45 2012
@@ -208,7 +208,7 @@ def setup_and_sync(sbox, dump_file_conte
return dest_sbox
-def verify_mirror(dest_sbox, exp_dump_file_contents):
+def verify_mirror(dest_sbox, src_sbox):
"""Compare the contents of the DEST_SBOX repository with
EXP_DUMP_FILE_CONTENTS."""
# Remove some SVNSync-specific housekeeping properties from the
@@ -221,9 +221,10 @@ def verify_mirror(dest_sbox, exp_dump_fi
# 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_and_display_lines(
- "Dump files", "DUMP", exp_dump_file_contents, dest_dump)
+ "Dump files", "DUMP", src_dump, dest_dump)
def run_test(sbox, dump_file_name, subdir=None, exp_dump_file_name=None,
bypass_prop_validation=False, source_prop_encoding=None,
@@ -249,12 +250,15 @@ or another dump file."""
# dump file (used to create the master repository) or another specified dump
# file.
if exp_dump_file_name:
- exp_master_dumpfile_contents = open(os.path.join(svnsync_tests_dir,
- exp_dump_file_name)).readlines()
+ build_repos(sbox)
+ svntest.actions.run_and_verify_load(sbox.repo_dir,
+ open(os.path.join(svnsync_tests_dir,
+ exp_dump_file_name)).readlines())
+ src_sbox = sbox
else:
- exp_master_dumpfile_contents = master_dumpfile_contents
+ src_sbox = sbox
- verify_mirror(dest_sbox, exp_master_dumpfile_contents)
+ verify_mirror(dest_sbox, sbox)
@@ -1012,7 +1016,9 @@ def delete_revprops(sbox):
run_copy_revprops(dest_sbox.repo_url, sbox.repo_url)
# Does the result look as we expected?
- verify_mirror(dest_sbox, expected_contents)
+ build_repos(sbox)
+ svntest.actions.run_and_verify_load(sbox.repo_dir, expected_contents)
+ verify_mirror(dest_sbox, sbox)
@Issue(3870)
@SkipUnless(svntest.main.is_posix_os)