You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(slm): four tests/api tests fail outside CI — pricing reads the deployed .env, admin-socket fails even alone #18234
Two SLM backend test files fail on a developer host and pass in CI, so a local run of autobot-slm-backend/tests/api is never clean. Each local failure has to be re-triaged as "pre-existing", and that is how a real regression hides. Seen while verifying #18186 / #17455: tests/api gives 774 passed and these 4 failures, which are identical on the base tree.
no step names the pricing refresh failure: ["pricing refresh: failed to start: [Errno 13] Permission denied: '<deploy root>/autobot-backend/.env' …"]
Not hermetic. api/_pricing_post_sync.py:97 reads the deployed.env under the real deploy root. On a host where that tree exists but is not readable by the test user, the refresh fails to start before the mocked failure is reached. CI has no deploy root, so the read is skipped.
The pricing tests point the deployed dir at a tmp_path (or patch _load_env_file), so no test reads the real deploy root. They pass on a host where that tree exists and is unreadable.
The admin-socket tests' dependence on services.local_admin_socket is root-caused and stated here. They pass when run alone, in any order.
python3 -m pytest autobot-slm-backend/tests/api is clean on a developer host that has a deployed tree.
Another instance of this class, from merge train #6b (#18379). tests/api/test_ssh_restart_equivalence_18186.py built a SyncOrchestrator(), which creates CODE_CACHE_DIR, defaulting to /var/lib/slm/code-cache. On a deployed dev host that directory exists, so the tests pass there. On a CI runner they fail with FileNotFoundError. Fixed in the train by pointing CODE_CACHE_DIR at tmp_path.
The class fix still belongs here: a test must not depend on a deployed host path existing, or not existing. A conftest guard could catch it by redirecting the known roots (/opt/autobot, /var/lib/slm, /etc/autobot) during tests.
Activity
mrveiss commentedon Oct 12, 2026
Another instance of this class, from merge train #6b (#18379).
tests/api/test_ssh_restart_equivalence_18186.pybuilt aSyncOrchestrator(), which createsCODE_CACHE_DIR, defaulting to/var/lib/slm/code-cache. On a deployed dev host that directory exists, so the tests pass there. On a CI runner they fail withFileNotFoundError. Fixed in the train by pointingCODE_CACHE_DIRattmp_path.The class fix still belongs here: a test must not depend on a deployed host path existing, or not existing. A conftest guard could catch it by redirecting the known roots (
/opt/autobot,/var/lib/slm,/etc/autobot) during tests.