[MERGE] Fix stacking tests applicability

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Dec 18 16:18:44 GMT 2008


>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:

    jam> Vincent Ladeuil wrote:
    >> Let's rephrase that hopefully more clearly.
    >> 
    >> From the premise that it should be possible to define an
    >> unstackable branch format that pass the test suite, I modified
    >> loom to be explicit about that. (Since it didn't pass the test
    >> suite I thought it was a valid modification until loom support
    >> stacking).
    >> 
    >> I had to modify some tests to reach that point.
    >> 
    >> I also fixed a typo in test_osutils.TestChunksToLines.test_is_compiled.
    >> 
    >> Vincent
    >> 
    >> P.S.: I missed one failing test in my previous submission, bad
    >> vila, stop abusing 'selftest -s' :)
    >> 
    >> 

    jam> BB:resubmit

    jam> I'm pretty sure this needs to be rethought:

    jam> -        if isinstance(self.branch_format, branch.BzrBranchFormat4):
    jam> -            raise tests.TestNotApplicable('Not a metadir format.')
    jam> +        if not self.branch_format.supports_stacking():
    jam> +            raise tests.TestNotApplicable('%r does not support stacking'
    jam> +                                    % self.branch_format)

    jam> ^- Basically, the test is *about* using a repository format which
    jam> supports stacking, and a *branch* format which does not. And ensuring
    jam> that we get a sane result when we are done.

    jam> You changed the test so that it only runs when we have a branch that
    jam> supports stacking... Which is not what we want.

Ok.

So, with that patch I posted earlier against loom, the tests are failing at the 

        push._show_push_branch(trunk, 'rev-2', self.get_url('remote'), output)

line with a traceback like:

  File "/net/bigmamac/Volumes/home/vila/src/bzr/experimental/selftest-stacking/bzrlib/tests/branch_implementations/test_push.py", line 220, in test_push_with_default_stacking_does_not_create_broken_branch
    push._show_push_branch(trunk, 'rev-2', self.get_url('remote'), output)
  File "/net/bigmamac/Volumes/home/vila/src/bzr/experimental/selftest-stacking/bzrlib/push.py", line 106, in _show_push_branch
    revision_id=revision_id, stacked_on=stacked_on)
  File "/net/bigmamac/Volumes/home/vila/src/bzr/experimental/selftest-stacking/bzrlib/bzrdir.py", line 233, in clone_on_transport
    repository_policy.configure_branch(result_branch)
  File "/net/bigmamac/Volumes/home/vila/src/bzr/experimental/selftest-stacking/bzrlib/bzrdir.py", line 2886, in configure_branch
    branch.set_stacked_on_url(stack_on)
  File "/home/vila/.bazaar/plugins/loom/branch.py", line 609, in set_stacked_on_url
    raise bzrlib.errors.UnstackableBranchFormat(self._format, self.base)

At which point I don't understand how to reconcile your remark
and the test...

    jam> Also:

    jam>              raise TestNotApplicable()
    jam>          # Avoid make_branch, which produces standalone branches.
    jam>          bzrdir = self.make_bzrdir('repo/stack-on')
    jam> -        try:
    jam> -            b = bzrdir.create_branch()
    jam> -        except errors.UninitializableFormat:
    jam> -            raise TestNotApplicable()
    jam> +        b = bzrdir.create_branch()

    jam> ^- Why did you do this one? Certainly there are formats
    jam> that cannot be initialized (our oldest branch format).

Because I thought that was included in the unstackable format
check ? But I can put it back if you prefer.

Keep in mind that I didn't try to understand the tests deeply,
just make them pass with one example of an unstackable branch
format.

        Vincent



More information about the bazaar mailing list