[MERGE] revert deletes files when it is safe

Robert Collins robertc at robertcollins.net
Fri Sep 29 00:59:51 BST 2006


On Wed, 2006-09-27 at 16:04 -0500, John Arbash Meinel wrote:
> 
> >>> I *think* Robert is wanting to switch the tests over to MemoryTree
> where
> >>> possible. Which means he can change build_tree_contents() to work
> on a
> >>> Transport, and not have to actually write to disk for lots of
> tests.
> > 
> > I'm not entirely comfortable with this kind of simulation, but I
> wasn't
> > trying to block it.  I think we should get Martin to write a sequel
> for
> > distcc: distunittest.
> 
> I think he was planning to only do it when the test cares more about
> the
> branch stuff, and not the working tree. And only uses a working tree
> to
> create revisions. Which is moderately safe IMO. 

Basically I want the test suite to be extremely fast again. 5 minutes is
too long for a good 'read, edit, run' loop. Running just a few tests
leads to surprises later on.

Ideally most tests will test one and only one thing. Support
infrastructure to test that thing should be unobtrusive and fast. For
instance, a test that WorkingTree.commit() uses commitbuilder in the
expected way does not need disk resources - so we can use a MemoryTree. 

Tests that test several layers at once are hard to debug and maintain :
they are fragile to layering changes (inappropriate intimacy); slow
(they require more setup); and can result in leaving the deeper layers
insufficiently tested (because they are used, so they work, right ?).

Theres an aggregate O(N^2) *at best* effect here, were some code paths
are used hugely more often than others, when they are not being tested.
So my goal is to reduce the constant factor on those tests as much as
possible - tests that need a branch dont need a working tree on disk. In
fact they often dont even need disk as they depend on the transport
layer.

As an exercise, run selftest under strace - we do a scary amount of IO -
and the vast bulk of it is *irrelevant* to the tests.

John - dumping to disk - I dont plan on that, we have a very good
introspection tool in pdb. I'm happy to defer converting tests where it
seems like that is important until there is a 'dump to disk after
failure' option, but honestly, in the last year I've used --keep-output
once.

-Rob


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060929/fd0a123a/attachment.pgp 


More information about the bazaar mailing list