Repository navigation
ci(test): run the offline integration suites and make the lane check blocking - #4344
Conversation
Nine test files no CI lane runs had been failing silently against APIs and contracts that changed underneath them. This brings them back to green against current main so the next change can put them in a lane. - test_sdk.py: assert the SDK surface that exists today (process_query via Agent.chat, the tool registry instead of the never-public execute_tool, openai_server's module-level app, Agent.STATE_* class constants, current RAGSDK/AudioClient/KokoroTTS methods, LLMClient as an ABC); drop the xfail DatabaseMixin block (it ships as gaia.database.mixin) and the placeholder docs-exist check. - test_multi_caller_equivalence.py: send the X-Gaia-UI header on mutating calls and read /api/connectors' "connectors" shape. - test_memory_integration.py: fresh installs are schema v4. - test_memory_api_integration.py: consolidation is 503 until a chat session registers a consolidator, and runs it once one has. - test_documents_router.py: two fixtures indexed for real and needed Lemonade. - test_tui_control_e2e.py: give the pty a size and a TERM like a terminal. - test_ui_email_scope_consent.py: the agent now declares microsoft_work too; drop three tests of the in-process /v1/email mount the UI no longer has. - test_lemonade_embedded_lifecycle.py: llamacpp:cpu has no macOS build. - test_email_mcp_stdio_parity.py: docstring said no Lemonade; triage uses it. - test_vlm_integration.py: deleted. A script that returned booleans instead of asserting, so it could not fail, and it called a removed constructor arg. Refs amd#4205
…blocking 43 test files ran in no CI lane, so they looked green on every PR whether they worked or not, and nothing stopped the count from growing. Now every test file is either run by a lane or listed with the reason CI can't run it, and lint fails the moment a new file is neither. - test_unit.yml gains an offline-integration job for the 23 files that need no Lemonade, live account or AMD hardware (with Go for the TUI e2e and the [mcp] extra for the SDK and MCP-server tests). - test_email_agent_unit.yml runs test_ui_email_scope_consent.py. - util/test_lane_allowlist.yml lists the 18 that need a live Lemonade Server, a real Gmail account, a self-hosted model runner, npm-fetched MCP servers, or are hand-run scripts, each with its reason. - util/lint.py runs check_test_lane_coverage.py as a blocking check (--test-lanes, and part of --all); lint.yml re-runs when the allowlist changes. Fixes amd#4205
|
Verdict: Approve with suggestions This closes a real hole: 43 test files were running in no CI lane, so they looked green on every PR whether they worked or not. Now each one either runs in a new offline job, or is listed with the reason CI can't run it, and lint fails the moment a new file is neither. One thing to fix before merge: the email-scope test was added to the email lane's command, but that workflow only starts when certain files change — and this file isn't on that list. So a PR that edits only that file still runs it nowhere, while the new checker reports it as covered. One line in the workflow's trigger list fixes it. Real-world evidenceNo And the negative case — I added a throwaway So the gate works in both directions. What I could not exercise is the new 🔍 Technical detailsNote: this diff contains both commits ( 🟡 ImportantEmail lane runs the new file but isn't triggered by it (
Add to both 🟢 MinorStale comment contradicts the new allowlist reason ( The new job can still skip a file wholesale and look green — the checker's own documented blind spot (
The Strengths
|
The file-search tests walked the real home directory, so on a developer machine one test ran past two minutes, and the results depended on what that user owned. Most assertions were hedged with "if found" because the fixture lived under ~/.gaia, which the search skips as hidden. The search tests now point HOME/USERPROFILE at a temp dir and write their files into its Documents folder, so each one asserts the exact result. The file runs in about 4 seconds with the real HOME set. Refs amd#4205
# Conflicts: # tests/test_vlm_integration.py
…free box Both files this PR repairs still failed in the offline lane, so the "534 passed" claim held only on the author's machine. The memory test built its URL by interpolating a local-timezone stamp. At a negative UTC offset the "-" is URL-safe and it passes; on a UTC runner the "+00:00" decodes to a space, fromisoformat rejects it, and the endpoint correctly 422s. Passing the stamp through the client's params lets it percent-encode, and a second pinned +00:00 case means the test now catches this from any timezone rather than only from UTC. The TUI test set TERM to get color, but termenv treats any environment with CI set as "not a TTY" before it looks at TERM or the pty, so lipgloss dropped to the Ascii profile and rendered no escapes at all for format=ansi to return. CLICOLOR_FORCE is the documented override, and NO_COLOR outranks it, so both it and CLICOLOR are cleared. Also resolves the merge with main: amd#4290 removed only one of this file's three fallback_model uses, and VLMClient no longer takes that argument, so the deletion stands.
…ew live-Lemonade suite tests/test_ui_email_scope_consent.py was added to the email lane's pytest command but not to its paths filters, so a PR editing only that file still ran it nowhere -- while the new checker counted it as covered, because the checker asks whether a lane names a file, not whether any trigger reaches that lane. Listed in both the push and pull_request blocks, next to the other individually-named tests/test_email_* entry. Merging main brought tests/integration/test_lemonade_predownload_checks.py, which the gate correctly flagged as run by no lane. It takes require_lemonade, so it is allowlisted rather than wired offline.
|
The two failures in this PR's own offline lane are fixed in #4343 and merged up, so the lane should now be honestly green rather than green-by-assertion. Neither was a flake: one test only passed west of Greenwich, and the other could never have passed in CI at all. Details on #4343. Also fixed the trigger gap the review found, and handled one thing main introduced. The email lane ran Merging main also brought a new integration file that no lane runs, and the new gate caught it — the check working on its first real encounter with a file nobody wired up. It needs a live Lemonade Server, so it's allowlisted with that reason. 🔍 Technical detailsGate after the merge: Local run of the job's exact file list (Windows, so not a like-for-like with the ubuntu lane): 515 passed, 21 skipped, 5 failed. All 5 PASSED in this PR's own CI run, so none is a real failure:
Allowlist entry: Still open, deliberately not widened here: the checker validates "a lane names this file", not "a trigger reaches that lane". The email entry above was found by reading, not by the gate, and nothing stops the next one. Unrelated red: the |
# Conflicts: # tests/integration/test_memory_integration.py
…2-4344 # Conflicts: # docs/reference/dev.mdx # util/lint.py
The only tests that run GAIA's MCP client against a real server were broken and ran in no CI lane. One still checked the `gaia mcp add` flow removed in amd#977. The other downloaded unpinned npm servers and broke when one renamed a tool. Both now start a small local server built on the official MCP SDK, so they download nothing and have no version to pin. They move from the allowlist into the offline-integration job. Stacked on amd#4344. Merge that first. This PR removes the two allowlist entries amd#4344 adds, which drops its allowlisted count from 18 to 16. - **Repaired, not deleted.** Every other MCP client and connectors test mocks the server process. These are the only tests that exchange real JSON-RPC with a live server. - **The workflow file now tests how users add a server today.** `gaia connectors configure` stores the secret in the keyring and writes a reference to it. An agent loads the server, the secret reaches the server's environment, and `gaia connectors disconnect` removes the server again. ## Test plan - [x] Before: with Node on PATH, the old files fail 4 of 8 (the pre-amd#977 config-write assertions and the renamed `sequentialthinking` tool) - [x] After: `pytest tests/mcp/test_mcp_cli_to_agent_workflow.py tests/mcp/test_mcp_sdk_integration.py` passes 9 of 9 in about 3 s, offline, with `GAIA_HOME`/`GAIA_DAEMON_HOME` isolated, in a clean py3.12 venv with `-e ".[api,mcp]"` - [x] Mutation check: stopping `$keyring` env resolution in the MCP client fails 2 of the new tests - [x] The offline-integration lane's file list passes locally in one session: 468 passed, 11 skipped. `tests/integration/test_files_router.py` is left out because its file-search tests hang on this Mac. That is unrelated to this PR. - [x] `tests/unit/mcp` + `tests/unit/connectors` pass: 1117 passed - [x] `python util/check_test_lane_coverage.py` exits 0 (850 files, 16 allowlisted). black, isort, and `pylint` errors-only are clean on the changed files - [ ] Watch the `Offline Integration Tests` job go green on Linux Fixes amd#4346 --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
Searching files in the Agent UI could walk the entire home directory with no limit. On a real machine one search took minutes, and it never returned at all if one directory read blocked, for example on a cloud mount or a macOS privacy prompt. Now a search stops after 20,000 entries or about 10 seconds and returns what it found so far. The file browser says so when a search stopped early. ## Test plan - [x] `python -m pytest tests/integration/test_files_search_budget.py -q`: 5 passed. All 5 fail on `main`. - [x] `python -m pytest tests/integration/test_files_search_budget.py tests/integration/test_files_router.py tests/unit/chat/ui/test_models.py -q`: 111 passed, 1 skipped. On this Mac, `test_files_router.py`'s search tests hung past 10 minutes against the real home dir before this change; each now returns at the ~11 s cap. - [x] `cd src/gaia/apps/webui && npx vitest run`: 400 passed. The new truncation-note test fails without the component change. - [x] `cd src/gaia/apps/webui && npx tsc --noEmit`: clean - [x] black, isort, pylint clean on the changed Python files - [ ] Manual: Agent UI file browser, search a common name on a large home dir, and see the "Search stopped early" note - [ ] `gaia eval agent`: the Agent UI MCP server's `search_files` tool result gains a `truncated` field <details> <summary>🔍 Technical details</summary> - The walk now runs on a dedicated daemon thread instead of the default executor. A deadline checked between entries can't interrupt a blocked `opendir`, so the endpoint also stops waiting at budget + 1 s grace. A stuck thread exits once its read returns, and it never holds a shared executor slot. - The `$HOME` pass skips the four priority folders it already walked at greater depth. - `truncated` is true only when the entry cap or time budget cut the walk short, not when `max_results` was reached. - Overlaps: amd#4345 adds a generated-types drift check. If it merges first, `api.gen.ts` needs regenerating for `FileSearchResponse.truncated`. amd#4348 edits other parts of `routers/files.py` (the upload dir). New tests are in their own file to stay clear of amd#4344/amd#4348's edits to `test_files_router.py`. The docs edit is outside amd#4340's hunks. </details> Fixes amd#4352 Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
…4353) About 300 unit tests never ran in CI. Their files skip as a whole when a hub wheel (`gaia_agent_chat`, `gaia_agent`, `gaia_agent_email`) or an optional extra is missing. The unit lane lacks them, but it still names the files, so the lane check counted them as covered. With this PR, each file runs in a lane that installs what it needs, and a lane fails when a file skips as a whole without an allowlist entry saying which lane runs it. Stacked on #4344. Merge #4343 and #4344 first. - **The new guard runs inside each lane**, right after install. It collects the job's own pytest commands in that lane's environment, so it sees what the lane actually runs. It reports the skipping file by name. This matters because a file that imports a skipping helper is otherwise blamed on the helper's line: `test_chat_inline_web_ssrf.py` was hidden that way. - **Two moved files needed repairs to pass together.** `test_chat_fix_contracts.py` picked up file tools leaked from earlier tests. `test_chat_system_prompt_budget.py` evicted the chat agent module at collection, so other files' patches stopped hitting it. - **Two files stay allowlisted with no lane, for an owner to decide.** `test_profilespec_characterization.py` has 11 golden rows that drifted, and its docstring says golden updates need sign-off. `test_tool_loader_token_budget.py` has 4 token and tool-count pins that are stale, and even re-pinned, one ratio is over budget. Overlaps: #4350 is also stacked on #4344 and edits the offline-integration list and the allowlist, so expect a small conflict there. #4038, #3721, #3669, #3812 and #3072 touch other parts of `test_unit.yml` and `test_gaia_agent.yml`. ## Test plan - [x] Before: `python util/check_module_skips.py --workflow test_unit.yml --job unit-tests` with no `module_skips` entries reports 80 files skipping wholesale and exits 1 - [x] After: the guard exits 0 for all 7 guarded jobs, each run in a clean py3.12 venv built from that job's install step - [x] `python util/check_test_lane_coverage.py` and `python util/lint.py --test-lanes` pass (31 module-skip entries verified) - [x] New tests: `pytest tests/unit/test_check_module_skips.py tests/unit/test_check_test_lane_coverage.py` passes 64. They include a real `--collect-only` over a temp repo - [x] Chat-lane files in the chat env: 421 passed. Before the two test repairs, 2 failed when run together - [x] Flagship-lane files in the gaia env: 59 passed. `test_mcp2_server.py` plus the MCP transcript tests in the MCP env: 27 passed - [x] Email unit lane's full command plus `test_synthetic_mbox.py`: 4980 passed - [x] The 4 newly unskipped files in the unit job (docx, pptx, reportlab, slack): 60 passed. Full `tests/unit/` in that env: 14509 passed, 23 failed. The failures are in 3 files (uninstall, CLI smoke, Lemonade ASR) that also fail when run alone. They come from this Mac's setup: `GAIA_HOME` isolated and `gaia` not on PATH. This PR changes no code those files exercise - [x] `actionlint` is clean on the 6 edited workflows. `black`, `isort`, and `pylint --errors-only` are clean on the changed Python - [ ] Watch the MCP lane's Windows leg run `test_mcp2_server.py` and the guard. They were only run on macOS locally Fixes #4206 --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Ovtcharov <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: f <f@f> Co-authored-by: probe <probe@local>
43 test files ran in no CI lane, so they looked green on every PR whether they worked or not. The checker from #4124 could see the gap but blocked nothing, so the count kept growing. After this PR, every test file either runs in a lane or is listed with the reason CI can't run it, and lint fails as soon as a new file is neither.
Stacked on #4343 — merge that first. It repairs the files this PR starts running.
offline-integrationjob intest_unit.yml. The job takes about 2 minutes of tests, in parallel with the unit job, so the unit job's 30-minute budget isn't touched. One more email file joins the email unit lane.tests/mcp/test_mcp_cli_to_agent_workflow.py,test_mcp_sdk_integration.py) fetch unpinned MCP servers from npm at test time and are broken today. Their entries say so, so a reviewer can decide whether to repair or delete them.test_search_finds_fileran past a 2-minute timeout, and most search assertions only checked results "if found". They now search a fake home and assert exact results;test_files_router.pytakes about 4 s with the realHOMEset.util/lint.py --all, which CI already runs.Overlaps: #4348 makes the whole of
test_files_router.pyuse a fake home, so it touches the same search tests. Whichever PR lands second resolves a small conflict. #4038 adds its own lint check in the same spots ofutil/lint.pyanddocs/reference/dev.mdx, so expect a trivial conflict there. #3669, #3721, and #3812 touch other parts oftest_unit.yml.Test plan
origin/main:python util/check_test_lane_coverage.pyreports 43 files and exits 1python util/lint.py --test-lanesfails when a new unwiredtests/test_*.pyis addedtest_search_finds_filehangs past 130 s on this branch before the fix, with the realHOMEset. After it, the whole oftest_files_router.pypasses in 4 s (75 passed, 1 skipped)actionlintis clean on the three edited workflows, andblack,isort, andpylint --errors-onlyare clean onutil/lint.pyOffline Integration Testsjob go green on Linux.test_backend_install_command_is_acceptedonly runs there (it's skipped on macOS), so CI is its first real runFixes #4205