[MERGE] Move the notes on writing tests out of HACKING into a new file, and improve them.

Andrew Bennetts andrew at canonical.com
Wed Aug 13 05:39:10 BST 2008


Robert Collins wrote:
> Splitting out little bits as I go..
> 
> On Wed, 2008-08-13 at 08:53 +1000, Andrew Bennetts wrote:
> > +TestPlatformLimit
> > +        **(Not implemented yet)**
> > +        The test can't be run because of an inherent limitation of
> > the
> > +        environment, such as not having symlinks or not supporting
> > +        unicode.
> > +
> > +UnavailableFeature
> > +        The test can't be run because a dependency (typically a
> > Python
> > +        library) is not available in the test environment.  These
> > +        are in general things that the person running the test could
> > fix
> > +        by installing the library.  It's OK if some of these occur
> > when
> > +        an end user runs the tests or if we're specifically testing
> > in a
> > +        limited environment, but a full test should never see them.
> 
> 
> Uhhh, the former thing is a subset of UnavailableFeature is it not? The
> specific examples given are both implemented using Features today, and I
> don't see what the proposed difference is.

This text happens to be untouched by my patch, just moved as-is!  So, I think
forcing people to re-read it is paying off ;)

I'd be happy to ditch TestPlatformLimit from this file.  The table a bit below
suggests that the intended distinction is that when running the test suite in
“strict” mode a test skipped platform limit will pass, but a test skipped due to
an unavailable feature will fail.  We seem to be doing just fine without having
implemented this distinction, so we probably shouldn't weigh our docs down with
it.

Hmm, I see looking at that table that a couple of places in this file say
“TestDependencyMissing” (which doesn't exist) when they should say
“UnavailableFeature” (which does).  I'll fix that.

-Andrew.




More information about the bazaar mailing list