[merge] clean up/separate pack repository tests

Martin Pool mbp at canonical.com
Mon Aug 4 02:09:35 BST 2008


On Mon, Aug 4, 2008 at 8:45 AM, Robert Collins
<robertc at robertcollins.net> wrote:
> On Mon, 2008-08-04 at 08:41 +1000, Robert Collins wrote:
>> On Fri, 2008-08-01 at 08:50 -0500, John Arbash Meinel wrote:
>> >+from StringIO import StringIO

I just copied that from the original file.  I would agree we should
normally be using cStringIO; I was just trying to make the minimum
changes to what is run.

>> > 2) The list you use for scenarios is both static and hidden. Which
>> > means that
>> > Robert's new groupcompress format won't be automatically form (static)
>> > and
>> > can't wedge itself in if it wants to (hidden).

It is still possible for them to apply these tests to themselves: just
import the test class and generate new instances of it pointing at the
appropriate scenarios.

I think changing them from subclasses to being scenarios is a step
towards being able to generate the scenarios dynamically, even if in
this case it's still a static list.  I would like to shuffle more of
the tests along in this direction, and then refine the way the
scenarios are defined and multiplied.

In some ways it would be nice to have this test look at all of the
registered formats and work out to which ones they ought to apply.
But on the other hand this is a test of the format internals, as
Robert says.

>> Its not really a problem - these are defined as being essentially static
>> tests anyhow - in groupcompress we just need a 3-element long scenario
>> list and we can parameterise the tests ourselves.
>
> Sorry, forgot to mention.
>
> Its not a problem because:
>  - there are tests for the interface anyhow (including stacking)
>  - I think its appropriate to have to make an explicit choice about
> whether these pack tests apply - just subclassing Pack shouldn't be
> enough (for instance the tests on delta-checking are completely bogus
> for groupcompress).

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list