You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2022/02/09 20:53:06 UTC
svn commit: r1897919 - in /subversion/branches/multi-wc-format/subversion/tests/cmdline: basic_tests.py svntest/main.py upgrade_tests.py
Author: julianfoad
Date: Wed Feb 9 20:53:05 2022
New Revision: 1897919
URL: http://svn.apache.org/viewvc?rev=1897919&view=rev
Log:
On the 'multi-wc-format' branch: Py tests use '--wc-format-version' option.
This patch uses the passed in '--wc-format-version' option value when
creating working copies, throughout the Python tests.
* subversion/tests/cmdline/basic_tests.py
(basic_auth_test): Append a '--compatible-version' option to checkout
commands.
* subversion/tests/cmdline/svntest/main.py
(_with_wc_format_version): New.
(run_svn): Append a '--compatible-version' option to checkout and upgrade
commands, if absent and needed.
(wc_format): New.
* subversion/tests/cmdline/upgrade_tests.py
(get_current_format): Get the expected format from the test framework.
Modified:
subversion/branches/multi-wc-format/subversion/tests/cmdline/basic_tests.py
subversion/branches/multi-wc-format/subversion/tests/cmdline/svntest/main.py
subversion/branches/multi-wc-format/subversion/tests/cmdline/upgrade_tests.py
Modified: subversion/branches/multi-wc-format/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/cmdline/basic_tests.py?rev=1897919&r1=1897918&r2=1897919&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/multi-wc-format/subversion/tests/cmdline/basic_tests.py Wed Feb 9 20:53:05 2022
@@ -2541,33 +2541,33 @@ def basic_auth_test(sbox):
# Set up a custom config directory
config_dir = sbox.create_config_dir()
+ common_opts = ('--config-dir', config_dir,
+ '--compatible-version', svntest.main.options.wc_format_version)
+
# Checkout with jrandom
exit_code, output, errput = svntest.main.run_command(
svntest.main.svn_binary, None, True, 'co', sbox.repo_url, wc_dir,
- '--username', 'jrandom', '--password', 'rayjandom',
- '--config-dir', config_dir)
+ '--username', 'jrandom', '--password', 'rayjandom', *common_opts)
exit_code, output, errput = svntest.main.run_command(
svntest.main.svn_binary, None, True, 'co', sbox.repo_url, wc_dir,
- '--username', 'jrandom', '--non-interactive', '--config-dir', config_dir)
+ '--username', 'jrandom', '--non-interactive', *common_opts)
# Checkout with jconstant
exit_code, output, errput = svntest.main.run_command(
svntest.main.svn_binary, None, True, 'co', sbox.repo_url, wc_dir,
- '--username', 'jconstant', '--password', 'rayjandom',
- '--config-dir', config_dir)
+ '--username', 'jconstant', '--password', 'rayjandom', *common_opts)
exit_code, output, errput = svntest.main.run_command(
svntest.main.svn_binary, None, True, 'co', sbox.repo_url, wc_dir,
- '--username', 'jconstant', '--non-interactive',
- '--config-dir', config_dir)
+ '--username', 'jconstant', '--non-interactive', *common_opts)
# Checkout with jrandom which should fail since we do not provide
# a password and the above cached password belongs to jconstant
expected_err = ["authorization failed: Could not authenticate to server:"]
exit_code, output, errput = svntest.main.run_command(
svntest.main.svn_binary, expected_err, True, 'co', sbox.repo_url, wc_dir,
- '--username', 'jrandom', '--non-interactive', '--config-dir', config_dir)
+ '--username', 'jrandom', '--non-interactive', *common_opts)
def basic_add_svn_format_file(sbox):
'test add --parents .svn/format'
Modified: subversion/branches/multi-wc-format/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/cmdline/svntest/main.py?rev=1897919&r1=1897918&r2=1897919&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/multi-wc-format/subversion/tests/cmdline/svntest/main.py Wed Feb 9 20:53:05 2022
@@ -793,6 +793,16 @@ def copy_trust(dst_cfgdir, src_cfgdir):
for f in os.listdir(src_ssl_dir):
shutil.copy(os.path.join(src_ssl_dir, f), os.path.join(dst_ssl_dir, f))
+def _with_wc_format_version(args):
+ if '--wc-format-version' in args:
+ return args
+ non_opt_args = [a for a in args if not str(a).startswith('-')]
+ if non_opt_args:
+ subcommand = non_opt_args[0]
+ if subcommand in ['co', 'checkout', 'upgrade']:
+ return args + ('--compatible-version', options.wc_format_version)
+ return args
+
def _with_config_dir(args):
if '--config-dir' in args:
return args
@@ -828,7 +838,7 @@ def run_svn(error_expected, *varargs):
you're just checking that something does/doesn't come out of
stdout/stderr, you might want to use actions.run_and_verify_svn()."""
return run_command(svn_binary, error_expected, False,
- *(_with_auth(_with_config_dir(varargs))))
+ *(_with_wc_format_version(_with_auth(_with_config_dir(varargs)))))
# For running svnadmin. Ignores the output.
def run_svnadmin(*varargs):
@@ -1729,6 +1739,13 @@ def is_httpd_authz_provider_enabled():
def is_remote_http_connection_allowed():
return options.allow_remote_http_connection
+def wc_format():
+ minor = int(options.wc_format_version.split('.')[1])
+ if minor >= 15 and minor <= SVN_VER_MINOR: return 32
+ if minor >= 8 and minor <= 14: return 31
+ raise Exception("Unrecognized wc_format_version '%s'" %
+ options.wc_format_version)
+
######################################################################
Modified: subversion/branches/multi-wc-format/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/cmdline/upgrade_tests.py?rev=1897919&r1=1897918&r2=1897919&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/multi-wc-format/subversion/tests/cmdline/upgrade_tests.py Wed Feb 9 20:53:05 2022
@@ -55,9 +55,8 @@ wc_is_too_old_regex = (".*is too old \(f
def get_current_format():
- # Get current format from subversion/libsvn_wc/wc.h
- format_file = open(os.path.join(os.path.dirname(__file__), "..", "..", "libsvn_wc", "wc.h")).read()
- return int(re.search("\n *# *define +SVN_WC__VERSION +(\d+)\n", format_file).group(1))
+ """Get the expected WC format."""
+ return svntest.main.wc_format()
def replace_sbox_with_tarfile(sbox, tar_filename,