[RFC] readonly branch and repository tests
Robert Collins
robertc at robertcollins.net
Fri Jun 22 06:05:06 BST 2007
On Fri, 2007-06-22 at 14:59 +1000, Martin Pool wrote:
> On 6/22/07, Robert Collins <robertc at robertcollins.net> wrote:
> > > In some ways it would be nice to have a different base class for these
> > > tests, so that they can be stored in the same file as the other tests
> > > for that logical area, but also clearly distinct.
> >
> > Thats another way of separating them, but it has the same failure mode -
> > put the method on the wrong subclass and it won't run on readonly
> > repositories.
>
> Well, you could hide make_repository and instead give people just apis
> that are very clearly either for preparing the repository and for
> examining it. I'm thinking about what we should do compared to
> get_readonly_transport, which basically does a good job but some tests
> seem to not quite use the right one.
I'm not sure what you mean... In the general structure of a test there
are three phases, which sometimes are clear and sometimes commingled
(being commingled isn't bad). They are preparation, execution, and
assertion. You prepare a fixture, you run the code under test, and you
assert that it did the right thing. The right thing may be defined as
'made the right calls to other objects' or 'ended up with the right
state' or any number of different things.
We have a range of tests where the execution phase will mutate the
object under test; thats incompatible with objects that cannot be
mutated *by design* - its not a 'skipped test' or 'missing resource' -
its 'something that should not be tested'.
I think hiding make_repository might be fine, but I don't see how that
addresses the problem you raised about people putting tests for the
'Read only repository interface' in the test area (however that is
defined) for the 'read write repository interface'.
-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: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070622/8faeb7d1/attachment.pgp
More information about the bazaar
mailing list