Default hook state and the test suite

John Arbash Meinel john at arbash-meinel.com
Mon Oct 18 22:35:13 BST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm worried about a whole in our testing setup. Specifically, we have at
least one case where by default we have a hook installed at runtime (by
bzrlib), and the test suite defaults to clearing all hooks. It means
that we aren't testing the "stock" behavior. Which was the point of
clearing the hooks (so that plugins wouldn't cause test failures when
they hook in for extra information.)


The bug is:
  https://bugs.launchpad.net/bugs/662053

Basically, "bzr status -r X..Y" was broken by the changes to 'bzr
status' to show the shelf information.

The reason it is broken is because only WorkingTree's implement
get_shelf_manager, but "bzr status -r X..Y" uses a RevisionTree.

The reason we didn't already catch the failure is because the new code
is injected via a hook. And the test suite is clearing out all hooks
before running.


It seems that we need a better answer than "clear out all hooks", in the
case that bzrlib is going to hook itself into these hooks.

Any thoughts?

For now, I just moved the "register this hook" override back into all of
the "bzr status" blackbox tests. But it feels like we should have a more
generic solution, because this is easily missed.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky8vZEACgkQJdeBCYSNAANTJQCgotF09s/KXFiE+o7ld1FvOjnF
tEgAnj961E+0GvjWqz1f7csrzr9sor6B
=7ats
-----END PGP SIGNATURE-----



More information about the bazaar mailing list