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

Re: svntest and directory structure

From: David James <djames_at_collab.net>
Date: 2006-06-19 22:45:55 CEST

On 6/19/06, Madan U Sreenivasan <madan@collab.net> wrote:
> > I'm not really sure what you're trying to do. Perhaps if you could
> > give a concrete example of what you want to use, where you want to use
> > it, and why a whole bunch of stuff needs to be moved around before
> > that's possible it would clarify things for me.
> The idea is to use a single testing framework for all the python test
> cases in the subversion code.
>
> Currently, the python bindings test cases depend on trac modules for
> unittesting. This could be removed if we use the svntest/TestCase.py
> module. Advantages of using the svntest module over the trac framework:
>
> - XFail(), Skip() functionality
> - It would be easier extend davautocheck functionality to the python
> bindings tests in the future.
>
> (Am not sure about this, but I think svntest/tree.py could be reused too)

The Python bindings do make use of some helper modules defined by
Trac, but the core technology behind our unit tests is not really the
Trac framework but in fact the Python unittesting framework. Some
resources:
- http://pyunit.sourceforge.net/
- http://docs.python.org/lib/module-unittest.html

Currently, the Python core unittest framework does not directly
support XFail or Skipped tests, but it's quite possible to extend it
to support these features. For an example, see
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466288

Note that the above recipe uses decorators and therefore requires
Python 2.4. We could probably tweak the above recipe to work with
Python 2.2 with a little bit of thinking.

In general, I don't see a compelling reason to switch the Python
bindings tests to use svntest. The svntest test suite is mainly
designed for testing the output of command-line programs. PyUnit is
designed to test Python programs.

PyUnit has many useful features which svntest does not. For example:
  assertRaises
  assertEqual
  failUnless

If svntest used PyUnit (the standard Python test framework), then we
might be able to make use of its features in the Python bindings. But,
right now, we don't do that -- instead, we rolled our own custom test
framework, which has some nice features, but is not as powerful in
general as PyUnit.

Some options for future work:
  - Extend the Python bindings test framework to support XFail tests

Some more controversial options:
  - Upgrade the 'svntest' framework to use PyUnit (NOTE: This switch
will require some careful design before we write any patches.)
  - Upgrade both the Python bindings test framework and the svntest
framework to share common code.

Madan, I think it'd be more useful if we focused on the simple things
first: Let's upgrade the Python bindings to support XFail tests, and
then write tests for any missing functionality using this feature.

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jun 19 22:46:36 2006

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