[MERGE] Add test for smart client invoking server-side hook on set_last_revision_info

Andrew Bennetts andrew at canonical.com
Mon Jul 14 00:36:40 BST 2008


Hi,

This patch just adds a test.  It tests that calling set_last_revision_info on a
RemoteBranch (i.e. using a smart client) will trigger the pre_change_branch_tip
hook on the server-side.  I think in the past we may have had the 'set_rh' hook
working similarly well, only to break it shortly afterwards without realising.
This test should help prevent us accidentally breaking this feature in future.

I've added a new test module for this, test_smart_integration.  I'm not wholly
satisfied with this, but no existing module seemed appropriate (and besides the
existing smart protocol test modules are too large already).

Also, I specifically wanted to have a test that was a bit more of an integration
test than a unit test, just to make it harder to accidentally break this
feature.  It feels to me that it would to be too easy to accidentally break this
if we relied purely on unit tests scattered across multiple modules (for the
client-side behaviour, and the server-side behaviour).  Obviously I want to use
this sort of test sparingly, so I've added a docstring to the module advising
against adding tests there.

This patch is against my '[RFC] Wait for child threads to finish in
SmartTCPServer_for_testing.tearDown' patch.  I don't think that patch is ready
for merging, so if this one is approved, I'll merge it without that change.

-Andrew.




More information about the bazaar mailing list