test for import failures for auto completes
Summary
bst is invoked sufficiently differently at complete time (on my Debian install with the standard install from source) that _stream.py can not be imported and if you import it into _frontend/cli.py then bst will crash for auto complete.
while this is not a bug as we do not currently import _stream.py in to _frontend/cli.py the failure is not catch by our tests.
I got some code quite close to getting merged before i noticed this behavour and so i think it would make a good subject of a regression test.
Steps to reproduce
import _stream.py in to _frontend/cli.py and then try to use auto complete. Note: i am not preposing to fix the bug but just to have a test that would catch it if any one tried to merge such a change.
What is the current bug behaviour?
This class of error is not caught by the tests:
will CT-will-S-Deb ~ projects buildstream buildstream willsalmon/defaultWorkspaces ? 1 $ bst sTraceback (most recent call last):
File "/home/will/.local/bin/bst", line 5, in <module>
from buildstream._frontend import cli
File "/home/will/projects/buildstream/buildstream/buildstream/_frontend/__init__.py", line 20, in <module>
from .cli import cli
File "/home/will/projects/buildstream/buildstream/buildstream/_frontend/cli.py", line 9, in <module>
from .._stream import DirectoryDescription
File "/home/will/projects/buildstream/buildstream/buildstream/_stream.py", line 33, in <module>
from ._scheduler import Scheduler, SchedStatus, TrackQueue, FetchQueue, BuildQueue, PullQueue, PushQueue
File "/home/will/projects/buildstream/buildstream/buildstream/_scheduler/__init__.py", line 22, in <module>
from .queues.fetchqueue import FetchQueue
File "/home/will/projects/buildstream/buildstream/buildstream/_scheduler/queues/fetchqueue.py", line 22, in <module>
from ... import Consistency
ImportError: cannot import name 'Consistency'
What is the expected correct behaviour?
This should be caught by the tests.