Author: julianfoad
Date: Wed Feb 4 15:47:27 2015
New Revision: 1657294
URL: http://svn.apache.org/r1657294
Log:
On the 'dump-load-cross-check' branch: undo intentional weakening of the
test suite's dumpfile parser.
Instead of not recording the number of blank lines between records, rather
at comparison time let the cross-check ignore these numbers selectively. By
default, including when some existing regression tests use the parser, do
not ignore them.
* subversion/tests/cmdline/svntest/sandbox.py
(Sandbox.verify_repo): Where necessary, tell compare_dump_files() to ignore
the number of blank lines between records.
* subversion/tests/cmdline/svntest/verify.py
(DumpParser.parse_one_node): Store the number of blank lines.
(compare_dump_files): Add a new option to ignore the number of blank lines
between records.
Modified:
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/verify.py
Modified:
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
URL:
http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py?rev=1657294&r1=1657293&r2=1657294&view=diff
==============================================================================
---
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
(original)
+++
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
Wed Feb 4 15:47:27 2015
@@ -409,9 +409,12 @@ class Sandbox:
and not svnrdump_headers_always.match(l)]
dumpfile_r_d_cmp = [l for l in dumpfile_r_d
if not svnrdump_headers_always.match(l)]
+ # Ignore differences in number of blank lines between node records,
+ # as svnrdump puts 3 whereas svnadmin puts 2 after a replace-with-copy.
svntest.verify.compare_dump_files(None, None,
dumpfile_a_d_cmp,
- dumpfile_r_d_cmp)
+ dumpfile_r_d_cmp,
+ ignore_number_of_blank_lines=True)
# Try loading the dump files.
# For extra points, load each with the other tool:
@@ -464,9 +467,12 @@ class Sandbox:
assert not exit_code and not errput
# Ignore empty prop sections in the input file during comparison, as
# svndumpfilter strips them.
+ # Ignore differences in number of blank lines between node records,
+ # as svndumpfilter puts 3 instead of 2 after an add or delete record.
svntest.verify.compare_dump_files(None, None, dumpfile, dumpfile2,
expect_content_length_always=True,
- ignore_empty_prop_sections=True)
+ ignore_empty_prop_sections=True,
+ ignore_number_of_blank_lines=True)
def verify(self, skip_cross_check=False):
"""Do additional testing that should hold for any sandbox, such as
Modified:
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/verify.py
URL:
http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/verify.py?rev=1657294&r1=1657293&r2=1657294&view=diff
==============================================================================
---
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/verify.py
(original)
+++
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/verify.py
Wed Feb 4 15:47:27 2015
@@ -676,9 +676,7 @@ class DumpParser:
blanks = 0
while self.current < len(self.lines) and self.parse_blank(required=False):
blanks += 1
- ### disable temporarily, as svnrdump behaves differently from svnadmin
- ### on a replace-with-copy (bug -- should file an issue)
- #node['blanks'] = blanks
+ node['blanks'] = blanks
return action, node
def parse_all_nodes(self):
@@ -728,7 +726,8 @@ class DumpParser:
def compare_dump_files(message, label, expected, actual,
ignore_uuid=False,
expect_content_length_always=False,
- ignore_empty_prop_sections=False):
+ ignore_empty_prop_sections=False,
+ ignore_number_of_blank_lines=False):
"""Parse two dump files EXPECTED and ACTUAL, both of which are lists
of lines as returned by run_and_verify_dump, and check that the same
revisions, nodes, properties, etc. are present in both dumps.
@@ -762,6 +761,8 @@ def compare_dump_files(message, label, e
del action_record['props']
old_content_length = int(action_record['content_length'])
action_record['content_length'] = str(old_content_length - 10)
+ if ignore_number_of_blank_lines:
+ action_record['blanks'] = 0
if parsed_expected != parsed_actual:
print 'DIFF of raw dumpfiles (including expected differences)'