Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r5381 - trunk/run-tests.py

cvs2svn
Discussion topic

Back to topic list

svn commit: r5381 - trunk/run-tests.py

Author mhagger
Full name Michael Haggerty
Date 2012-04-20 02:23:06 PDT
Message Author: mhagger
Date: 2012-04-20 02:23:05-0700
New Revision: 5381

Modified:
   trunk/run-tests.py

Log:
Fix some test cases to deal with non-deterministic dump output.

I started getting some test failures for use_rcs() and
internal_co_exclude() after switching to 64-bit Ubuntu "precise". I
don't know whether the difference is caused by changes to Subversion,
the change from 32 to 64-bit architecture, or something else.

These tests both run the same conversion twice: once with the
--use-rcs option and once without. Then they "svnadmin dump" the
resulting Subversion repositories and verify that the dump outputs are
line-by-line identical (aside from the repository UUIDs).

These two tests are now failing because the output of "svnadmin dump"
for the two repositories differs, even though the repositories are
logically the same. (In particular, the order that properties are
output varies.) It is not clear whether Subversion's behavior has
changed, or whether these tests only used to work by accident, but
either way, the tests are easy to fix...

The old tests converted into Subversion repositories, then dumped the
repositories, then compared the dumps. Instead, change the tests to
convert directly into dumpfiles and compare the dumpfiles. Since
cvs2svn takes pains to output properties in a deterministic order,
this should be robust.

With this change, the tests work again.

Modified: trunk/run-tests.py
Url: http://cvs2svn.tigri​s.org/source/browse/​cvs2svn/trunk/run-te​sts.py?view=diff​&pathrev=5381&r1​=5380&r2=5381
====================​====================​====================​==================
--- trunk/run-tests.py (original)
+++ trunk/run-tests.py 2012-04-20 02:23:05-0700
@@ -3185,19 +3185,15 @@
   "verify that --use-rcs and --use-internal-co agree"
 
   rcs_conv = ensure_conversion(
- 'main', args=['--use-rcs', '--default-eol=native'],
+ 'main', args=['--use-rcs', '--default-eol=native'], dumpfile='use-rcs-rcs.dump',
       )
   conv = ensure_conversion(
- 'main', args=['--default-eol=native'],
+ 'main', args=['--default-eol=native'], dumpfile='use-rcs-int.dump',
       )
   if conv.output_found(r'WARNING\: internal problem\: leftover revisions'):
     raise Failure()
- rcs_lines = run_program(
- svntest.main.svnadmin_binary, None, 'dump', '-q', '-r', '1:HEAD',
- rcs_conv.repos)
- lines = run_program(
- svntest.main.svnadmin_binary, None, 'dump', '-q', '-r', '1:HEAD',
- conv.repos)
+ rcs_lines = list(open(rcs_conv.dumpfile, 'rb'))
+ lines = list(open(conv.dumpfile, 'rb'))
   # Compare all lines following the repository UUID:
   if lines[3:] != rcs_lines[3:]:
     raise Failure()
@@ -3210,19 +3206,17 @@
   rcs_conv = ensure_conversion(
       'internal-co',
       args=['--use-rcs', '--exclude=BRANCH', '--default-eol=native'],
+ dumpfile='internal-c​o-exclude-rcs.dump',​
       )
   conv = ensure_conversion(
       'internal-co',
       args=['--exclude=BRANCH', '--default-eol=native'],
+ dumpfile='internal-c​o-exclude-int.dump',​
       )
   if conv.output_found(r'WARNING\: internal problem\: leftover revisions'):
     raise Failure()
- rcs_lines = run_program(
- svntest.main.svnadmin_binary, None, 'dump', '-q', '-r', '1:HEAD',
- rcs_conv.repos)
- lines = run_program(
- svntest.main.svnadmin_binary, None, 'dump', '-q', '-r', '1:HEAD',
- conv.repos)
+ rcs_lines = list(open(rcs_conv.dumpfile, 'rb'))
+ lines = list(open(conv.dumpfile, 'rb'))
   # Compare all lines following the repository UUID:
   if lines[3:] != rcs_lines[3:]:
     raise Failure()

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r5381 - trunk/run-tests.py mhagger Michael Haggerty 2012-04-20 02:23:06 PDT
Messages per page: