[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1151916 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 28 Jul 2011 21:34:52 +0300

julianfoad_at_apache.org wrote on Thu, Jul 28, 2011 at 16:37:56 -0000:
> Author: julianfoad
> Date: Thu Jul 28 16:37:55 2011
> New Revision: 1151916
>
> URL: http://svn.apache.org/viewvc?rev=1151916&view=rev
> Log:
> Revert r1151672 and r1151680 which made the test suite fail to run all or
> many of the Python tests while still reporting success.
>
> The original combined log message of the two revs was effectively:
>
> Bump the Python tests' equivalent of SVN_VER_MINOR. Since I'm too
> lazy to make this parse svn_version.h, opt for the least-maintenance
> solution:
>
> * subversion/tests/cmdline/svntest/main.py
> (_create_parser): Make 'server_minor_version' default to inf (positive
> infinity).
> (_parse_options): Account for the change.

The following patch seems to run properly both via 'make check' and via
running individual tests. (It does pass --server-minor-version=inf
internally; I can address that later.)

[[[
Index: subversion/tests/cmdline/svntest/main.py
===================================================================
--- subversion/tests/cmdline/svntest/main.py (revision 1151954)
+++ subversion/tests/cmdline/svntest/main.py (working copy)
@@ -1515,7 +1515,7 @@ def _create_parser():
 
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
- server_minor_version=8,
+ server_minor_version=float('+inf'), # positive infinity
         url=file_scheme_prefix + pathname2url(os.path.abspath(os.getcwd())),
         http_library=_default_http_library)
 
@@ -1539,8 +1539,9 @@ def _parse_options(arglist=sys.argv[1:]):
 
   # If you change the below condition then change
   # ../../../../build/run_tests.py too.
- if options.server_minor_version < 3 or options.server_minor_version > 8:
- parser.error("test harness only supports server minor versions 3-8")
+ if options.server_minor_version not in (None, float('inf')):
+ if options.server_minor_version < 3 or options.server_minor_version > 8:
+ parser.error("test harness only supports server minor versions 3-8")
 
   if options.url:
     if options.url[-1:] == '/': # Normalize url to have no trailing slash
Index: build/run_tests.py
===================================================================
--- build/run_tests.py (revision 1151954)
+++ build/run_tests.py (working copy)
@@ -110,7 +110,7 @@ class TestHarness:
     self.server_minor_version = server_minor_version
     # If you change the below condition then change in
     # ../subversion/tests/cmdline/svntest/main.py too.
- if server_minor_version is not None:
+ if options.server_minor_version not in (None, float('inf')):
       if int(server_minor_version) < 3 or int(server_minor_version) > 8:
         sys.stderr.write("Test harness only supports server minor versions 3-8\n")
         sys.exit(1)
@@ -311,7 +311,7 @@ class TestHarness:
     if self.fs_type is not None:
       cmdline.append('--fs-type=' + self.fs_type)
     if self.server_minor_version is not None:
- cmdline.append('--server-minor-version=' + self.server_minor_version)
+ cmdline.append('--server-minor-version=' + str(self.server_minor_version))
     if self.list_tests is not None:
       cmdline.append('--list')
     if self.mode_filter is not None:
@@ -399,7 +399,7 @@ class TestHarness:
     if self.http_library is not None:
       svntest.main.options.http_library = self.http_library
     if self.server_minor_version is not None:
- svntest.main.options.server_minor_version = int(self.server_minor_version)
+ svntest.main.options.server_minor_version = float(self.server_minor_version)
     if self.list_tests is not None:
       svntest.main.options.list_tests = True
     if self.milestone_filter is not None:
]]]

At this point, though, I decided that r1151957 would be the clearer approach.
Received on 2011-07-28 20:37:22 CEST

This is an archived mail posted to the Subversion Dev mailing list.