Skip to content

Commit 4dc0942

Browse files
committed
fix: use venv crossbar in functional tests instead of PATH
The functional tests were using `exe = 'crossbar'` which relies on PATH resolution. On GitHub Actions runners with Ubuntu, this picks up /snap/bin/crossbar instead of the venv's crossbar, causing tests to fail. Fixed by: - start_crossbar(): Use virtualenv parameter to find crossbar binary - start_cfx(): Derive venv bin dir from sys.executable Note: This work was completed with AI assistance (Claude Code).
1 parent 8db715e commit 4dc0942

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

test/functests/helpers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,9 @@ def start_crossbar(reactor, virtualenv, cbdir, crossbar_config, log_level=False,
327327
reactor, finished, launched,
328328
stdout=stdout, stderr=stderr,
329329
)
330-
# exe = path.join(virtualenv, 'bin', 'crossbar')
331-
# exe = os.path.abspath('./crossbar-linux-amd64-20190129-085ba04')
332-
exe = 'crossbar'
333-
#exe = '/usr/local/bin/crossbar-linux-amd64-20190130-684dd82'
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')
334333
args = [exe, 'start', '--cbdir', cbdir]
335334
if log_level:
336335
levels = ("critical", "error", "warn", "info", "debug", "failure", "trace")
@@ -370,9 +369,10 @@ def start_cfx(reactor, personality, cbdir, config=None, log_level=False, stdout=
370369
reactor, finished, launched,
371370
stdout=stdout, stderr=stderr,
372371
)
373-
# exe = os.path.abspath('./crossbar-linux-amd64-20190129-085ba04')
374-
#exe = '/usr/local/bin/crossbar-linux-amd64-20190130-684dd82'
375-
exe = 'crossbar'
372+
# Use the crossbar from the same virtualenv as the running Python
373+
# to avoid picking up system installations (e.g., /snap/bin/crossbar on Ubuntu)
374+
venv_bin = path.dirname(sys.executable)
375+
exe = path.join(venv_bin, 'crossbar')
376376
args = [exe, personality, 'start', '--cbdir', str(cbdir)]
377377
if log_level:
378378
levels = ("critical", "error", "warn", "info", "debug", "failure", "trace")

0 commit comments

Comments
 (0)