Skip to content

Commit 0da4005

Browse files
committed
fix: use pytest's venv for crossbar in functional tests
The previous fix incorrectly used the virtualenv fixture path for the crossbar executable. That fixture creates a temp venv for component isolation (when --no-install is not used), but the crossbar CLI is in the venv running pytest (sys.executable's directory). Both start_crossbar() and start_cfx() now derive the crossbar path from sys.executable, avoiding both: 1. The snap /snap/bin/crossbar interference on Ubuntu 2. Missing crossbar in the temp virtualenv fixture Note: This work was completed with AI assistance (Claude Code).
1 parent 4dc0942 commit 0da4005

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/functests/helpers.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,12 @@ def start_crossbar(reactor, virtualenv, cbdir, crossbar_config, log_level=False,
327327
reactor, finished, launched,
328328
stdout=stdout, stderr=stderr,
329329
)
330-
# Use the crossbar from the virtualenv to avoid picking up system installations
331-
# (e.g., /snap/bin/crossbar on Ubuntu)
332-
exe = path.join(virtualenv, 'bin', 'crossbar')
330+
# Use the crossbar from the same directory as the running Python to avoid
331+
# picking up system installations (e.g., /snap/bin/crossbar on Ubuntu).
332+
# Note: The virtualenv fixture parameter is for component test isolation, not
333+
# for finding the crossbar executable. The crossbar CLI is in the venv running pytest.
334+
venv_bin = path.dirname(sys.executable)
335+
exe = path.join(venv_bin, 'crossbar')
333336
args = [exe, 'start', '--cbdir', cbdir]
334337
if log_level:
335338
levels = ("critical", "error", "warn", "info", "debug", "failure", "trace")

0 commit comments

Comments
 (0)