Fix #2065: decouple test/test-all from venv prerequisite - #2072
Conversation
The sandbox container pre-installs pytest, ruff, mypy, and the rest of the dev tools globally (sandbox/Dockerfile lines 156-178), but never installs uv. The Makefile comment at lines 12-13 already documents this intent: "CI uses venv (via uv sync); the sandbox has tools installed globally." However, `test:` and `test-all:` were declared with `venv` as a prerequisite, and `venv:` hard-errors when uv is missing — so the BRC tester running inside the sandbox could never invoke `make test` and silently fell back to ad-hoc pytest invocations that miss half of pyproject.toml's testpaths (PR #2061 / CI run 24937921821). Add a `sync-venv-if-uv` target that delegates to `venv` only when uv is on PATH, and depend on it from `test:` and `test-all:` instead. Dev machines and CI continue to get the same `uv sync --extra dev` behavior; the sandbox now falls through to the existing PYTEST/PYTHON system-PATH fallbacks already wired into the Makefile. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Review: PR #2072 — decouple test/test-all from venv prerequisite
Focused, well-targeted Makefile fix. The diagnosis matches the code: venv: (Makefile:105-114) hard-fails with ERROR: uv is not installed. when uv is absent, and test: / test-all: previously listed it as a strict prerequisite. The sandbox image (sandbox/Dockerfile:141-178) installs pytest/ruff/mypy via pip3 but does not install uv, so the prereq couldn't be satisfied there. The new sync-venv-if-uv target (Makefile:118-124) preserves uv sync behaviour on dev machines and CI (where uv is present) while degrading to a clean no-op in the sandbox, where the existing PYTEST/PYTHON system-PATH fallbacks (Makefile:14-19) take over.
No blocking issues. CI is green (Unit Tests + lint pass on this branch).
Non-blocking observations
-
Other
venv-prereq targets are unchanged.smoketest-long-poll(Makefile:356),test-integration(Makefile:381),test-e2e(Makefile:385), andtest-security(Makefile:389) still hard-depend onvenv. They require Docker/API keys and aren't expected to run inside the sandbox, so this is fine for the scope of #2065 — flagging only because if the BRC tester ever invokessmoketest-long-poll, it'll hit the sameERROR: uv is not installed.wall this PR was written to remove. -
Test plan item still unchecked. The PR body marks "Confirm in-sandbox
make testruns the full changeset-aware selection on the next BRC run" as unverified. Worth observing on the next sandbox run before considering #2065 fully closed — local dev testing doesn't exercise the failure mode the PR fixes. -
Failure-mode UX trade-off. When uv is missing, the previous
venv:recipe produced an actionable "ERROR: uv is not installed." with install instructions. With this change, a misconfigured environment that lacks both uv andpyteston PATH will silently no-op throughsync-venv-if-uv, then fail later with a less specificpytest: command not foundfrom line 311. The comment block onsync-venv-if-uvdocuments the intent clearly enough that I don't think this needs a guard, but worth being aware of. -
$(MAKE)invocation pattern. Line 124 invokes$(MAKE) venvfrom inside an@ifshell conditional, mirroring the existingdeps:pattern at line 99. Neither uses the+prefix, so neither propagates the GNU Make jobserver — fine here sinceuv syncis a single process, just noting it's consistent with the existing convention rather than something to change.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
| egg is addressing review feedback... |
|
Thanks for the thorough review. Acknowledging the four non-blocking observations:
No code changes required. Leaving as-is. — Authored by egg |
|
egg feedback addressed. View run logs 1 previous review(s) hidden. |
Summary
sandbox/Dockerfilelines 156-178) but does not shipuv. The Makefile comment at lines 12-13 already documents this design ("CI uses venv (via uv sync); the sandbox has tools installed globally"), buttest:andtest-all:were declared withvenvas a hard prerequisite — andvenv:exits withERROR: uv is not installed.when uv is missing.make test, fell back to ad-hocpytestinvocations that missed half ofpyproject.toml'stestpaths, and several failing tests slipped through to CI on PR Improve generalized reviewer with subagent fan-out and lens reviewers #2061 (see run 24937921821).sync-venv-if-uvtarget that delegates tovenvonly whenuvis on PATH; depend on it fromtest:andtest-all:. Dev machines and CI continue to runuv sync --extra devexactly as before; the sandbox now uses the existing PYTEST/PYTHON system-PATH fallbacks the Makefile already wires up.Closes #2065.
Test plan
make testandmake test-allstill triggeruv syncon a host with uv installed.env -i PATH=/bin:/usr/bin make sync-venv-if-uvis a clean no-op when uv is absent.make testruns the full changeset-aware selection on the next BRC run.🤖 Generated with Claude Code