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

[PATCH] Show correct error when running python tests with srcdir!=builddir

From: Tobias Schäfer <tobiasschaefer_at_gmx.de>
Date: 2005-12-29 16:00:59 CET

Hi all,

I followed the instructions from http://svn.collab.net/repos/svn/trunk/INSTALL
which say how to build subversion outside of the source directory.

"
C. Building under Unix in Different Directories
      --------------------------------------------

      It is possible to configure and build Subversion on Unix in a
      directory other than the working copy. For example

          $ svn co http://svn.collab.net/repos/svn/trunk svn
          $ cd svn
          $ # get neon/apr as required
          $ chmod +x autogen.sh
          $ ./autogen.sh
          $ mkdir ../obj
          $ cd ../obj
          $ ../svn/configure [...with options as appropriate...]
          $ make
"

This worked fine.

I then changed into the directory subversion/tests/cmdline/ and executed
"./commit-tests.py 1" and this bailed out with:

"UNEXPECTED EXCEPTION:
Traceback (most recent call last):
  File
"/usr/local/src/svn/subversion-trunk/svn/subversion/tests/cmdline/svntest/testcase.py",
line 108, in run
    rc = apply(self.pred.func, args)
  File "subversion/tests/cmdline/commit_tests.py", line 135, in
commit_one_file
    sbox.build()
  File
"/usr/local/src/svn/subversion-trunk/svn/subversion/tests/cmdline/svntest/main.py",
line 564, in build
    if actions.make_repo_and_wc(self):
  File
"/usr/local/src/svn/subversion-trunk/svn/subversion/tests/cmdline/svntest/actions.py",
line 762, in make_repo_and_wc
    guarantee_greek_repository(sbox.repo_dir)
  File
"/usr/local/src/svn/subversion-trunk/svn/subversion/tests/cmdline/svntest/actions.py",
line 72, in guarantee_greek_repository
    main.create_repos(main.pristine_dir)
  File
"/usr/local/src/svn/subversion-trunk/svn/subversion/tests/cmdline/svntest/main.py",
line 421, in create_repos
    "[general]\nauth-access = write\npassword-db = passwd\n");
  File
"/usr/local/src/svn/subversion-trunk/svn/subversion/tests/cmdline/svntest/main.py",
line 395, in file_append
    fp = open(path, 'a') # open in (a)ppend mode
IOError: [Errno 2] No such file or directory:
'svn-test-work/local_tmp/repos/conf/svnserve.conf'
FAIL: commit_tests.py 1: commit one file
"

What actually went wrong, was that the command "../../../svnadmin" could not
be found (remember the obj-directory which lies outside of the source
directory!) and therefore the blank repository could not be created in
svn-test-work/local_tmp/repos/

So in subversion/tests/cmdline/svntest/main.py I changed
svnadmin_binary = os.path.abspath('../../subversion/svn/svn' + _exe)
to
svnadmin_binary = os.path.abspath('../../../../obj/subversion/svn/svn' + _exe)

I also changed the other paths in the same way. The tests were then all
successfull.

With the attached patch the correct error is printed out:
['/bin/sh: /usr/local/src/svn/subversion-trunk/svn/subversion/subversion/svnadmin/svnadmin:
No such file or directory\n']
EXCEPTION: SVNRepositoryCreateFailure
FAIL: commit_tests.py 1: commit one file
"

This doesn't solve the problem that the tests don't run when subversion is
built in a directory other than the source tree but at least the correct error
is shown. I don't have a solution for this problem but maybe someone has an
idea.

[[[
If executing the python tests in subversion/tests/cmdline fails to create a
blank repository the test is now immediately stopped and the error is shown
on stdout. Before this change the failure was ignored silently and following
actions were executed on a non-existant repository which just had to fail.
Example: the repository can not be created when building subversion outside of
the source tree, because the relative paths to svnadmin are invalid.
]]]

Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Dec 29 16:03:12 2005

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