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

Re: [PATCH] run_tests.py - Restrict values to --server-minor-version.

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 5 Jul 2011 18:05:14 +0300

Noorul Islam K M wrote on Tue, Jul 05, 2011 at 11:47:22 +0530:
> Daniel Shahaf <d.s_at_daniel.shahaf.name> writes:
>
> > At least this needs cross-referencing comments to svntest/main.py which
> > does the same check.
> >
>
> I agree. Please find attached updated patch.
>
> > I don't know (and haven't looked) whether it's possible to have direct
> > code reuse in this case.
> >
>
> I don't think it is possible.
>
> Log
> [[[
>
> * build/run_tests.py
> (main): Restrict --server-minor-version to take values in the range
> 4-7.
>
> * subversion/tests/cmdline/svntest/main.py
> (_parse_options): Add cross-referencing comment.
>
> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
> ]]]
>
> Thanks and Regards
> Noorul
>

> Index: subversion/tests/cmdline/svntest/main.py
> ===================================================================
> --- subversion/tests/cmdline/svntest/main.py (revision 1142624)
> +++ subversion/tests/cmdline/svntest/main.py (working copy)
> @@ -1519,6 +1519,9 @@
> parser.error("'verbose' and 'quiet' are incompatible")
> if options.fsfs_packing and not options.fsfs_sharding:
> parser.error("--fsfs-packing requires --fsfs-sharding")
> +
> + # If you change the below condition then change in
> + # ../../../../build/run_tests.py too.
> if options.server_minor_version < 4 or options.server_minor_version > 7:
> parser.error("test harness only supports server minor versions 4-7")
>
> Index: build/run_tests.py
> ===================================================================
> --- build/run_tests.py (revision 1142624)
> +++ build/run_tests.py (working copy)
> @@ -604,6 +604,14 @@
> logfile = os.path.abspath('tests.log')
> faillogfile = os.path.abspath('fails.log')
>
> + # If you change the below condition then change in
> + # ../subversion/tests/cmdline/svntest/main.py too.
> + if server_minor_version:
> + minor_version = int(server_minor_version)
> + if minor_version < 4 or minor_version > 7:
> + sys.stderr.write("Test harness only supports server minor versions 4-7\n")
> + sys.exit(1)
> +

Several points here:

* I'll rework the code to only use variables named
  `server_minor_version', as that's a very helpful convention

* I'd like to move the code to TestHarness so that windows benefits
  from it too

So:

[[[
Index: build/run_tests.py
===================================================================
--- build/run_tests.py (revision 1142871)
+++ build/run_tests.py (working copy)
@@ -108,6 +108,12 @@ class TestHarness:
     self.fs_type = fs_type
     self.http_library = http_library
     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 int(server_minor_version) < 4 or int(serer_minor_version) > 7:
+ sys.stderr.write("Test harness only supports server minor versions 4-7\n")
+ sys.exit(1)
     self.verbose = verbose
     self.cleanup = cleanup
     self.enable_sasl = enable_sasl
Index: subversion/tests/cmdline/svntest/main.py
===================================================================
--- subversion/tests/cmdline/svntest/main.py (revision 1143037)
+++ subversion/tests/cmdline/svntest/main.py (working copy)
@@ -1522,6 +1522,9 @@ def _parse_options(arglist=sys.argv[1:]):
     parser.error("'verbose' and 'quiet' are incompatible")
   if options.fsfs_packing and not options.fsfs_sharding:
     parser.error("--fsfs-packing requires --fsfs-sharding")
+
+ # If you change the below condition then change
+ # ../../../../build/run_tests.py too.
   if options.server_minor_version < 4 or options.server_minor_version > 7:
     parser.error("test harness only supports server minor versions 4-7")
 
]]]

Now, in the interest of JFDIing I'll commit that. If you disagree or
have suggestions for improvements do make them, I'm trying to keep
things moving not to force one way of doing them.

P.S. Is there a link that says what my last sentence says more verbosely?
Received on 2011-07-05 17:06:53 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.