fix(install): skip browser download when system chromium exists

This commit is contained in:
helix4u 2026-05-13 18:37:06 -06:00 committed by Teknium
parent 7f08cb5941
commit 52521c937a
4 changed files with 173 additions and 54 deletions

View file

@ -41,6 +41,16 @@ class TestChromiumSearchRoots:
class TestChromiumInstalled:
def test_true_when_plain_chromium_on_path(self, monkeypatch):
monkeypatch.delenv("AGENT_BROWSER_EXECUTABLE_PATH", raising=False)
monkeypatch.setattr(
bt.shutil,
"which",
lambda name: "/usr/bin/chromium" if name == "chromium" else None,
)
assert bt._chromium_installed() is True
def test_true_when_chromium_dir_present(self, monkeypatch, tmp_path):
monkeypatch.setenv("PLAYWRIGHT_BROWSERS_PATH", str(tmp_path))
(tmp_path / "chromium-1208").mkdir()
@ -108,4 +118,3 @@ class TestRunBrowserCommandChromiumGuard:
"""