Code review comment for lp:~vila/bzr/321320-isolate-doc-tests

Revision history for this message
Vincent Ladeuil (vila) wrote :

So, it turns out that deleting HOME from the environment doesn't
annoy our test suite even slightly, so I did just that. I then
run this branch on babune to see how our various supported OSes
react against homeless tests and the result is: nothing. Not a
single test failed, much to my surprise I should say.

But once you accept that indeed our code and our tests don't need
it, it feels cleaner (and should address spiv's concerns about
GPG, if it doesn't, yell !).

Note that we still have tests that write to $HOME/.bzr.log
(better tracked by running with 'BZR_HOME=. ./bzr selftest'), but
they aren't doctests and as such are out of scope for this fix.

If someone (mgz ?) really feels strongly about adding more
isolation to doctests then feel free to do so, I've prepare
things a bit by adding two functions isolated_doctest_setUp and
isolated_doctest_tearDown that accept a 'test' parameter so it
should be possible to force them to run in a tmpdir.

But since there wasn't any leak I could find that would benefit
from such an isolation, I stopped there.

Now, to come back to spiv's first comment:
> My suspicion was right: this branch does not appear to fix 321320, except sometimes by accident.

> If you e.g. run 'bzr selftest' from your home dir, HOME is set to your real home, and config values in your normal ~/.bazaar/bazaar.conf like create_signatures take effect. In my case that cases gnome-gpg to be run for every commit the test suite does. At best that will slow down the tests considerably, at worst cause test hangs or test failures. This case definitely ought to work, and if bug 321320 is properly fixed, it would.

Would you mind checking this behaviour with bzr trunk ?

And is it fixed now ?

If it isn't, can you point me to the *doctest* you think is exhibiting this behaviour ?

« Back to merge proposal