From 8eb06e75b9dbf29dfad90683a8efef546e0058e0 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 29 Jul 2026 21:18:35 -0700 Subject: [PATCH] =?UTF-8?q?fix(tests):=20stub=20=5Fensure=5Fvercel=5Fsdk?= =?UTF-8?q?=20in=20vercel=20sandbox=20tests=20=E2=80=94=20CI=20has=20no=20?= =?UTF-8?q?vercel=20dist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tests fake the vercel SDK entirely via sys.modules, but _ensure_vercel_sdk checks installed DISTRIBUTION metadata through tools.lazy_deps.ensure(): on CI (no vercel dist + lazy installs disabled) it raised FeatureUnavailable→ImportError before the fake SDK was ever reached — 16 failures on slice 6, green on dev boxes that happen to have vercel==0.7.2 installed. Failure mechanism reproduced locally by forcing _is_satisfied False; fixture patch verified to close it while the real-dist path stays green (16/16). --- tests/tools/test_vercel_sandbox_environment.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/tools/test_vercel_sandbox_environment.py b/tests/tools/test_vercel_sandbox_environment.py index 13225a35975..65eb1ba2a85 100644 --- a/tests/tools/test_vercel_sandbox_environment.py +++ b/tests/tools/test_vercel_sandbox_environment.py @@ -221,7 +221,17 @@ def vercel_module(vercel_sdk, monkeypatch): monkeypatch.setattr("tools.credential_files.iter_cache_files", lambda **kwargs: []) module = importlib.import_module("tools.environments.vercel_sandbox") - return importlib.reload(module) + module = importlib.reload(module) + # These tests fully fake the vercel SDK via sys.modules (vercel_sdk + # fixture) — the real package is never exercised, so the lazy-install + # probe must not run: _ensure_vercel_sdk checks installed DISTRIBUTION + # metadata (not sys.modules), and on a host without the vercel dist + + # with lazy installs disabled (any hermetic env) it raises ImportError + # before the fake SDK is ever reached. 16 tests failed exactly this way + # in CI while passing on dev boxes that happened to have vercel==0.7.2 + # installed. + monkeypatch.setattr(module, "_ensure_vercel_sdk", lambda: None) + return module @pytest.fixture()