Skip SSH tests when a system-wide executable is missing.
Review Request #12147 — Created March 14, 2022 and submitted
A long-standing, annoying issue that has plagued many of us developing
on Review Board have been Bazaar SSH unit tests failing with Repository
Not Found errors.
This is actually due to Bazaar not being installed locally in a
directory part of the system path established when running a command via
SSH, without the shell's configuration setting up a normal path. For
ssh localhost bzrwon't result in a
executed (just a
~/.zshenv). It certainly won't be found in a
virtualenv. This leads to the error.
This is actually not limited to Bazaar. CVS, Git, and Subversion tests
are suceptible to the same problem, but are more likely to have their
corresponding command line tools available in standard system paths.
This change reworks the SSH unit tests to perform tool lookups in order
to avoid this issue. Now, when computing whether SSH tests can be
performed for a given setup, it will SSH locally and run
commands, caching results. If a tool can't be found, tests will be
skippped, along with a helpful error message aimed at resolving the
This requires opt-in from the test suites.
can be set to a list of command line tools needed for a successful SSH
test run. All will be checked, and if any are missing, the tests will
This should avoid annoying, hard-to-diagnose test failures going
Altered the system path on login (in
~/.zshenv) to avoid having any
Ran the test suite before this fix and saw errors with the SSH tests.
Ran after the fix and saw skip messages instead.
Added all necessary paths and re-ran. Saw 100% test completion.
pytest -rsto verify the presence and content of skip messages.