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

Re: Test writing

From: <kfogel_at_collab.net>
Date: 2005-07-07 21:46:59 CEST

Erik Huelsmann <ehuels@gmail.com> writes:
> Working through some test-writing last weekend myself, I decided more
> information is required about writing tests. I wrote an initial
> document (more of an outline) about writing tests to extend our test
> suite. You can find it at:
>
> http://svn.collab.net/repos/svn/trunk/notes/test-writing
>
> I'd like to invite our (new) SoC students to extend the document while
> working on their specific parts of the test suite (if appropriate) and
> supply patches.
>
> From the older devs I'd like to ask a few minutes of their time to put
> in what they need, or at least provide me with comments about
> incorrectnesses or missing elements.

I think overall the content in the file is great -- very useful!

However, I'm not sure that content belongs in a new file in notes/.
We already describe our test system here:

   subversion/tests/README
   subversion/tests/clients/cmdline/README

(And HACKING just refers to the first of those.)

So maybe one or both of those READMEs should just be enhanced?

Also, your new document incongruously has this section:

   ** C test coding
   ================
   
   (Could someone fill in this section please?!)

But the rest of the file is entirely about the Python regression test
suite. Since that's where most new tests are written, I'd say don't
say a word about writing C tests -- we hardly ever do that these days,
and anyway the C tests are a lot easier to figure out than the Python
tests anyway.

A second point:

The important thing about the Python tests is not that they are
written in Python, but that they are the regression test framework for
the command-line client. So make *that* be the direction from which
you introduce them. Then as an aside point out that this framework is
written in Python, and explain the important things about that
framework. If you just start out talking about the "Python tests",
the reader won't know what you're referring to, and will wonder why
you're emphasizing the language the tests are written in instead of
their functionality.

Also, here:

    * Minimize the use of 'run_command' and 'run_svn'
   
      The output of these commands is not checked by the test suite
      itself, so if you really need to use them, be sure to check
      any relevant output yourself.
   
      If you have any choice at all not to use them, please don't.

Great, but then give a positive recommendation too: to use
run_and_verify_svn() :-).

    * File accesses can't use hardcoded '/' characters
   
      Because the tests need to run on platforms with different path
      separators too (MS Windows), you need to use the os.path.join()
      function to concatenate path strings.

Point out that URLs *should* use "/" always (people sometimes confuse
them with local paths).

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 7 22:35:27 2005

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.