fix(tests): sweep the tests that drifted from August/September code changes (#2802) - #2804
Conversation
…hanges (#2802) Found by running every tier by hand on the 2026-09-14 pre-release pass (tests/run-full.sh itself aborts before the api tier — #2801). None of these is a product defect; each was verified against the commit that changed the behaviour. Backend guards / Postgres: - test_1920 scanned the mounted enterprise submodule; OSS guards scan the OSS tree only (#1677 convention — the private repo owns its twin). - test_alembic_postgres asserted alembic_version == 0001_baseline AFTER upgrade_to_head(), true only while head was the baseline (v0.8.0). The runner stamps the baseline and then upgrades; assert head. Root live-backend tier: - test_cb_probe_execution_close: the credential_sanitizer stub lacked REDACTION_PLACEHOLDER (exported by the real module since 2026-02), so every test failed at import; three more surfaced as "module 'routers' has no attribute 'internal'" from the same cause. - test_agent_permissions: `type` was retired with the taxonomy (#2104). - test_settings / test_setup: accept the #2715 onboarding wording. - test_activities: the activity layer's documented sources (user/schedule/agent/system) are valid alongside the dashboard buckets. - test_agent_git: 409 on sync for a read-only public-template agent is the ent#162 push blackhole — a fixture limit (skip), and for the owner-gate test evidence the gate passed (accepted). - test_platform_default_model / test_subscription_auto_switch asserted an instance default that stored state overrides; skip honestly on an enabled instance, and clear the stored row before reading the default. Frontend e2e (outside the @smoke tier CI runs): - schedules-toggle-scroll looked for 'Loading schedules...' but the panel renders a Unicode ellipsis since #2573; match on a regex. - ent438-agent-canvas assumed a seeded weather-watch agent; probe-and-skip like the other fixture-bound specs (#2199 semantics kept). - Four specs picked agents[0]; prefer the long-lived harness agent (#2080) so an overlapping pytest run cannot delete their fixture mid-test. Verified: 25 passed / 2 honest skips across the touched backend tests against a live dev stack; test_alembic_postgres 6 passed on a fresh disposable Postgres; the five e2e specs 23 passed / 3 skipped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
merge-train: deferred to the next train, not ejected. The sweep validated READY — every swept test still executes the behaviour it guards, and none was weakened into a source-text or no-op assertion. It is held only because of a collision. #2797 rewrites the same function this PR patches: it replaces Worth fixing in the same pass, because the rebase touches exactly this line. The PR body says the enterprise submodule "owns its own twin (#1677 convention)", and it does not — Two riders, both informational. |
…#2804) Mechanical conflict resolution, per the merge-train note on the PR. dev's #2742 replaced the single-tree `_iter_backend_py()` with the two-tree `_iter_guarded_py()` (src/backend + docker/base-image/agent_server), yielding `(path, root, prefix)`. This branch edited the old single-tree signature, so git spliced dev's loop body under this branch's header — `root` undefined. Neither side is correct alone: taking this branch's side reverts #2742's two-tree walk (re-opening the Invariant #5 failure its own docstring cites); taking dev's side drops the enterprise/ exclusion this PR exists to add; and a naive port raises ValueError on every agent-server path, which does not live under src/backend. Resolved per-root: `rel = path.relative_to(root)`, exclusion applied inside dev's iterator. Added `venv/` alongside, so the guard is green on a dev machine with a local src/backend/venv (it was not before). tests/unit/test_1920_no_hand_rolled_single_flight.py: 6 passed, including #2742's test_both_trees_are_actually_walked and test_agent_server_single_flight_has_exactly_one_home. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
merge-train: a mechanical fix was pushed to this branch
Why it needed care: dev's #2742 ( Both naive resolutions are wrong:
Resolved per-root: kept dev's iterator, moved the exclusion inside it against
Not fixed — yours to judgeValidation raised these; none blocks the merge, and I left them alone rather than guess:
The vacuity audit came back clean, which was the thing worth checking on a test sweep: exactly one assertion deleted (correct — the field is genuinely gone from the live payload), three skips all narrowly scoped, zero xfails, and 🤖 Generated with Claude Code |
Summary
Closes #2802.
Running every test tier by hand on the 2026-09-14 pre-release pass of
dev(the full-suite script aborts before the api tier — #2801) surfaced tests that no longer match the code they test. None is a product defect; each was checked against the commit that changed the behaviour. This PR brings them back into line without touching product code.Changes
Backend guards / Postgres
tests/unit/test_1920_no_hand_rolled_single_flight.py— scan the OSS tree only; the enterprise submodule owns its own twin (bug: platform operator-queue alert emitters bypass #1632 ingestion caps — skill-not-found is agent-triggerable (flood residual, gates pull default-ON) #1677 convention).tests/integration/test_alembic_postgres.py— a pre-Alembic DB is stamped at the baseline and then upgraded, so assert head, not0001_baseline(only true at v0.8.0).Root live-backend tier (
tests/test_*.py, not run in CI)test_cb_probe_execution_close.py— thecredential_sanitizerstub now exports what the real module exports (REDACTION_PLACEHOLDERsince 2026-02); all 10 tests pass again.test_agent_permissions.py—typeretired in refactor: retire the vestigial agenttypetaxonomy (business-assistant everywhere) #2104.test_settings.py,test_setup.py— accept the feat(onboarding): browser admin claim, one first-run overlay, credentials without a terminal (trinity-enterprise#580, #581, #582) #2715 onboarding wording.test_activities.py— the activity layer's documentedtriggered_bysources are valid alongside the dashboard buckets.test_agent_git.py— 409 on sync for a read-only public-template agent is the ent#162 push blackhole: skip (nothing to push) / accept as owner-gate evidence.test_platform_default_model.py,test_subscription_auto_switch.py— stop asserting an instance default that stored state overrides.Frontend e2e (outside the
@smoketier)schedules-toggle-scroll.spec.js— the panel rendersLoading schedules…(Unicode ellipsis, refactor(ui): the non-chart skeleton sweep, and the sidebar ordered by most recent collaboration (#1921, abilityai/trinity-enterprise#491) #2573); match on a regex.ent438-agent-canvas.spec.js— probe-and-skip when the seededweather-watchagent is absent (bug: 7 frontend e2e specs fail on stale constants and a missing fixture agent #2199 semantics kept: a broken probe still throws).agent-detail-request-dedupe,agent-detail-tasks-fill-height,background-refresh-invisible,schedules-toggle-scroll— prefer the long-lived harness agent (Test harness: honest full-suite runs — fix collection breakage, add PG/Alembic + git-sync tiers, skip-audit gate #2080) overagents[0], so an overlapping pytest run cannot delete the fixture mid-test.Verification
WORKSPACE_ENABLEDset).test_alembic_postgres.pyon a fresh disposable Postgres withREDIS_URLexported: 6 passed.agent-detail-tasks-fill-height.spec.js:147(short-viewport composer) failed twice and passed twice across four runs against the same agent — timing/agent-state flake, unrelated to this sweep.🤖 Generated with Claude Code
https://claude.ai/code/session_01DWLiE3uBHt6JBuKZk8hsRn