Merge lp:~maxb/launchpad/bug-497731 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~maxb/launchpad/bug-497731 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
151 lines (+26/-40) 4 files modified
lib/lp/codehosting/__init__.py (+16/-4) lib/lp/codehosting/sshserver/tests/test_session.py (+2/-2) lib/lp/codehosting/tests/test_acceptance.py (+5/-3) lib/lp/codehosting/tests/test_lpserve.py (+3/-31) |
||||
| To merge this branch: | bzr merge lp:~maxb/launchpad/bug-497731 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Guilherme Salgado (community) | code | 2010-02-19 | Approve on 2010-02-19 |
|
Review via email:
|
|||
Commit Message
Keep the Python dist-packages directory off the bzr plugin path, thus fixing testsuite failures when incompatible bzr plugins are installed there.
| Max Bowsher (maxb) wrote : | # |
| Guilherme Salgado (salgado) wrote : | # |
<salgado> no, just remove get_BZR_
<maxb> That's not acceptable because the bare directory is required for the load_plugins([...]) call ~10 lines below
<salgado> oh, I missed that
<salgado> why is it required there?
<maxb> The way it works is that if you're calling that bzrlib call directly, bzrlib uses *exactly* the directories you pass it. If you're setting the environment variable, bzrlib augments it with the standard directories unless you use the magic tokens to tell it not to
<salgado> I see
<salgado> maxb, then we can rename the existing one to _get_bzr_
<maxb> Sounds good
<salgado> maxb, also, it'd be nice to state in the new docstring why we use the "-site" magic token
| Michael Hudson-Doyle (mwhudson) wrote : | # |
I'm going to tweak a docstring formatting wise and then I'll land this.

I observed some test failures which turned out to be because of unclean stderr, when a Launchpad bzr subprocess tried to load plugins from my /usr/lib/ python2. 5/dist- packages/ bzrlib/ plugins/ directory, when those plugins required bzr 2.0 (my system bzrlib) but Launchpad's bzrlib is an incompatible eggified 2.1.
The root of the problem is that bzr shouldn't be trying to load plugins from /usr/lib/ python2. 5/dist- packages/ bzrlib/ plugins/ at all, in a Launchpad scenario. Happily, bzr 2.1 adds extra syntax to BZR_PLUGIN_PATH which allows us to tell it not to: we need to add "-site" as a component of BZR_PLUGIN_PATH.
So, here's a simple patch to do just that. In doing so, we get to clean up a big block of code which *tried* (but failed because its regexps were not quite right) to tolerate these warnings in stderr.
To QA this without running the entire testsuite, you should run bin/test -t lp.codehosting. tests.test_ lpserve.
NB: You need to have some .deb-packaged plugins which are not compatible with bzrlib 2.1 installed to manifest the actual test failures.