On recent versions of Debian GNU/Linux, the 'python' command doesn't normally
exist. Instead, there are separate 'python3' and 'python2' commands.
As a result, four tests fail in the Subversion test suite as of r1885910, all
for the same reason: the 'subversion/tests/cmdline/svneditor.py' mock editor
starts out with "#!/usr/bin/env python" at the top, but there is no 'python'
program on the system. See details at footnote [1].
Now, it's true that all the Python-based test files also have "#!/usr/bin/env
python" at the top. But in practice they're actually invoked using whatever
Python is specified by the environment variable SVN_TEST_PYTHON, which is set
to Python's 'sys.executable' as part of running the tests.
The problem is that SVN_TEST_PYTHON is not used for the invocation of
svneditor.py -- instead, svneditor.py is just run directly, as per this code in
subversion/tests/cmdline/svntest/main.py:
# The location of our mock svneditor script.
if windows:
svneditor_script = os.path.join(sys.path[0], 'svneditor.bat')
else:
svneditor_script = os.path.join(sys.path[0], 'svneditor.py')
So, one solution would be to just commit this change...
Index: subversion/tests/cmdline/svntest/main.py
===================================================================
--- subversion/tests/cmdline/svntest/main.py (revision 1885910)
+++ subversion/tests/cmdline/svntest/main.py (working copy)
@@ -129,7 +129,8 @@
if windows:
svneditor_script = os.path.join(sys.path[0], 'svneditor.bat')
else:
- svneditor_script = os.path.join(sys.path[0], 'svneditor.py')
+ svneditor_script = sys.executable + " " + \
+ os.path.join(sys.path[0], 'svneditor.py')
# Username and password used by the working copies
wc_author = 'jrandom'
...which, somewhat to my surprise, seems to work :-), at least with preliminary
testing. I'd run it through the full test suite before committing, of course.
Another solution would be to create a 'svneditor.sh' that just runs
'${SVN_TEST_PYTHON} /path/to/svneditor.py $@'.
I'm posting to get others' thoughts on how best to solve this. If the above
patch looks good, let me know and I'll test & commit it.
(This is all yak-shaving on the way to a somewhat more interesting, albeit
minor, patch that I'll post once we get this resolved.)
Best regards,
-Karl
[1] Here are the detailed reports from the failing tests:
START: commit_tests.py
[...]
W: /usr/bin/env: 'python': No such file or directory
W: subversion/svn/propedit-cmd.c:278,
W: subversion/libsvn_subr/cmdline.c:1678,
W: subversion/libsvn_subr/cmdline.c:1615: (apr_err=SVN_ERR_EXTERNAL_PROGRAM)
W: svn: E200012:
system('/home/kfogel/src/subversion/subversion/tests/cmdline/svneditor.py
"svn-prop.tmp"') returned 32512
W: CWD: /home/kfogel/src/subversion/subversion/tests/cmdline
W: EXCEPTION: Failure: Command failed:
"/home/kfogel/src/subversion/subversion/svn/svn propedit -m msg ..."; exit code
1
Traceback (most recent call last):
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
1927, in run
rc = self.pred.run(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/testcase.py",
line 258, in run
return self._delegate.run(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/testcase.py",
line 178, in run
result = self.func(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/commit_tests.py", line
2358, in propedit_with_revprop
sbox.repo_url)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/actions.py", line
340, in run_and_verify_svn
expected_exit, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/actions.py", line
378, in run_and_verify_svn2
exit_code, out, err = main.run_svn(want_err, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
818, in run_svn
*(_with_auth(_with_config_dir(varargs))))
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
445, in run_command
None, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
666, in run_command_stdin
'"; exit code ' + str(exit_code))
Failure: Command failed: "/home/kfogel/src/subversion/subversion/svn/svn
propedit -m msg ..."; exit code 1
FAIL: commit_tests.py 48: set revision props during remote property edit
START: prop_tests.py
W: /usr/bin/env: 'python': No such file or directory
W: subversion/svn/propedit-cmd.c:278,
W: subversion/libsvn_subr/cmdline.c:1678,
W: subversion/libsvn_subr/cmdline.c:1615: (apr_err=SVN_ERR_EXTERNAL_PROGRAM)
W: svn: E200012:
system('/home/kfogel/src/subversion/subversion/tests/cmdline/svneditor.py
"svn-prop.tmp"') returned 32512
W: CWD: /home/kfogel/src/subversion/subversion/tests/cmdline
W: EXCEPTION: Failure: Command failed:
"/home/kfogel/src/subversion/subversion/svn/svn propedit editme
svn-test-work/working_copies/prop_tests-1/A/mu ..."; exit code 1
Traceback (most recent call last):
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
1927, in run
rc = self.pred.run(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/testcase.py",
line 178, in run
result = self.func(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/prop_tests.py", line 88,
in make_local_props
os.path.join(wc_dir, 'A', 'mu'))
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
818, in run_svn
*(_with_auth(_with_config_dir(varargs))))
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
445, in run_command
None, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
666, in run_command_stdin
'"; exit code ' + str(exit_code))
Failure: Command failed: "/home/kfogel/src/subversion/subversion/svn/svn
propedit editme svn-test-work/working_copies/prop_tests-1/A/mu ..."; exit code 1
FAIL: prop_tests.py 1: write/read props in wc only (ps, pl, pdel, pe)
W: /usr/bin/env: 'python': No such file or directory
W: subversion/svn/propedit-cmd.c:278,
W: subversion/libsvn_subr/cmdline.c:1678,
W: subversion/libsvn_subr/cmdline.c:1615: (apr_err=SVN_ERR_EXTERNAL_PROGRAM)
W: svn: E200012:
system('/home/kfogel/src/subversion/subversion/tests/cmdline/svneditor.py
"svn-prop.tmp"') returned 32512
W: CWD: /home/kfogel/src/subversion/subversion/tests/cmdline
W: EXCEPTION: Failure: Command failed:
"/home/kfogel/src/subversion/subversion/svn/svn propedit prop1 -m ..."; exit
code 1
Traceback (most recent call last):
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
1927, in run
rc = self.pred.run(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/testcase.py",
line 178, in run
result = self.func(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/prop_tests.py", line
1172, in url_props_ops
'propedit', prop1, '-m', 'editlog', iota_url)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
818, in run_svn
*(_with_auth(_with_config_dir(varargs))))
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
445, in run_command
None, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
666, in run_command_stdin
'"; exit code ' + str(exit_code))
Failure: Command failed: "/home/kfogel/src/subversion/subversion/svn/svn
propedit prop1 -m ..."; exit code 1
FAIL: prop_tests.py 16: property operations on a URL
START: update_tests.py
[...]
W: /usr/bin/env: 'python': No such file or directory
W: The external merge tool
'/home/kfogel/src/subversion/subversion/tests/cmdline/svneditor.py' exited with
exit code 127.
W: svn: warning: apr_err=SVN_ERR_EXTERNAL_PROGRAM
W: svn: warning: W200012: The external merge tool
'/home/kfogel/src/subversion/subversion/tests/cmdline/svneditor.py' exited with
exit code 127.
W: subversion/svn/update-cmd.c:188,
W: subversion/svn/resolve-cmd.c:157:
(apr_err=SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE)
W: svn: E155027: Failure occurred resolving one or more conflicts
W: CWD: /home/kfogel/src/subversion/subversion/tests/cmdline
W: EXCEPTION: Failure: Command failed:
"/home/kfogel/src/subversion/subversion/svn/svn update --accept=launch
--force-interactive ..."; exit code 1
Traceback (most recent call last):
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
1927, in run
rc = self.pred.run(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/testcase.py",
line 178, in run
result = self.func(sandbox)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/update_tests.py", line
3774, in update_accept_conflicts
rho_path_backup)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/actions.py", line
340, in run_and_verify_svn
expected_exit, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/actions.py", line
378, in run_and_verify_svn2
exit_code, out, err = main.run_svn(want_err, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
818, in run_svn
*(_with_auth(_with_config_dir(varargs))))
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
445, in run_command
None, *varargs)
File
"/home/kfogel/src/subversion/subversion/tests/cmdline/svntest/main.py", line
666, in run_command_stdin
'"; exit code ' + str(exit_code))
Failure: Command failed: "/home/kfogel/src/subversion/subversion/svn/svn
update --accept=launch --force-interactive ..."; exit code 1
FAIL: update_tests.py 38: update --accept automatic conflict resolution