Skip to content

ci(test): run the offline integration suites and make the lane check blocking - #4344

Merged
kovtcharov-amd merged 13 commits into
amd:mainfrom
kovtcharov:claude/test-lane-blocking
Sep 26, 2026
Merged

kovtcharov-amd merged 13 commits into
amd:mainfrom
kovtcharov:claude/test-lane-blocking

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • 23 files that need no Lemonade, live account, or AMD hardware now run in a new offline-integration job in test_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.
  • 18 files are allowlisted with a reason. Most need a live Lemonade Server, a real Gmail account, or a self-hosted model runner; two are hand-run scripts. Two of them (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.
  • The file-search tests no longer walk the real home directory. On a developer Mac, test_search_finds_file ran 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.py takes about 4 s with the real HOME set.
  • The check is now blocking in util/lint.py --all, which CI already runs.

Overlaps: #4348 makes the whole of test_files_router.py use 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 of util/lint.py and docs/reference/dev.mdx, so expect a trivial conflict there. #3669, #3721, and #3812 touch other parts of test_unit.yml.

Test plan

  • Before, on origin/main: python util/check_test_lane_coverage.py reports 43 files and exits 1
  • After: the checker exits 0 (850 files, 18 allowlisted), and python util/lint.py --test-lanes fails when a new unwired tests/test_*.py is added
  • The new job's exact file list passes locally in a clean py3.12 venv matching its install step, with homes isolated and Lemonade unreachable: 534 passed, 12 skipped
  • test_search_finds_file hangs past 130 s on this branch before the fix, with the real HOME set. After it, the whole of test_files_router.py passes in 4 s (75 passed, 1 skipped)
  • The email lane's full command plus the added file passes: 4971 passed
  • actionlint is clean on the three edited workflows, and black, isort, and pylint --errors-only are clean on util/lint.py
  • Watch this PR's Offline Integration Tests job go green on Linux. test_backend_install_command_is_accepted only runs there (it's skipped on macOS), so CI is its first real run

Fixes #4205

Kalin Ovtcharov added 2 commits September 25, 2026 00:40
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
@github-actions

Copy link
Copy Markdown
Contributor

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 evidence

No evidence-bundle.md was produced for this PR. The changed surface here is a CLI gate, so I exercised it directly in the review container against this checkout:

$ python util/check_test_lane_coverage.py
[OK] 850 test file(s) across 7 root(s) are all named by a lane or allowlisted (78 workflow file(s) scanned, 18 allowlisted).

$ python util/lint.py --test-lanes
| Test Lane Coverage             | [OK] PASS  | -         |
[SUCCESS] ALL QUALITY CHECKS PASSED!

And the negative case — I added a throwaway tests/test_zz_review_probe.py, re-ran, and removed it:

[!] 1 test file(s) are run by no CI lane. Each one looks like a pass on every PR whether it works or not. Wire it into a lane, or add it to test_lane_allowlist.yml with a one-line reason:
    - tests/test_zz_review_probe.py
| Test Lane Coverage             | [X] FAIL   | 1 error   |

So the gate works in both directions. What I could not exercise is the new Offline Integration Tests job itself — no Lemonade, no Go toolchain, and no network-dependent artifact download here — so the claim that its 23 files pass rests on the author's local run and on the job's first CI run. The author has already flagged that test_backend_install_command_is_accepted has never run anywhere but this PR; worth watching that job go green before merge, since the lane is blocking from day one.

🔍 Technical details

Note: this diff contains both commits (7fdb7c66 test repairs + 4c65114d CI wiring), since the PR is stacked on #4343 with base main. The review covers both.

🟡 Important

Email lane runs the new file but isn't triggered by it (.github/workflows/test_email_agent_unit.yml:37, :71)

tests/test_ui_email_scope_consent.py is added to the pytest step (line 182) but not to the push/pull_request paths: filters. Every other individually-named file in that lane is listed there — tests/test_email_openapi_conformance.py, tests/unit/test_email_sidecar_devmode_app.py, tests/unit/test_daemon_forward.py, tests/unit/test_daemon_remedy_commands.py. A PR that edits only this file triggers test_unit.yml (via tests/**) and lint.yml, neither of which runs it, so the exact failure mode this PR fixes survives for that one file — and check_test_lane_coverage.py credits it as covered, because it only asks "does a lane name it", not "does a trigger reach that lane".

Add to both paths: blocks, next to the other tests/test_email_* entry:

      - 'tests/test_email_openapi_conformance.py'
      - 'tests/test_ui_email_scope_consent.py'

🟢 Minor

Stale comment contradicts the new allowlist reason (hub/agents/email/python/gaia_agent_email/mcp_server.py:220). The allowlist entry for tests/mcp/test_email_mcp_stdio_parity.py correctly says both surfaces triage with the local LLM — EmailTriageService.triage_request always builds a chat client (api_routes.py:512) and llm_triage raises LLMTriageError rather than falling back. But mcp_server.py still documents skip_lemonade=True as "triage is rule-based, so no LLM". Outside this diff, but it's the one place a reader will go to check the allowlist reason.

The new job can still skip a file wholesale and look green — the checker's own documented blind spot (check_test_lane_coverage.py:28-32), now inherited by offline-integration. The local run reported 12 skips and nothing pins which. -ra on the pytest invocation would at least print the skip reasons in the job log; a --collect-only count guard is the real fix and is already scoped as the second half of #4121.

test_lemonade_embedded_lifecycle.py downloads the artifact once per test. running_instance is function-scoped over a fresh tmp_path, so the ~5 MB artifact is fetched and the server started six times per CI run, plus the backend install. Fine for correctness (the idempotency tests need their own instance), but a session-scoped tmp_path_factory home shared as the artifact cache would cut most of it. Optional follow-up.

The test_vlm_integration.py deletion isn't mentioned in the PR description, which accounts for 23 wired + 18 allowlisted files. It was a print-based script (not asserting), depended on a data/pdf/ fixture, and told the reader to run lemonade-server serve — a command that no longer exists — so deleting rather than allowlisting is the right call. Worth one line so a reviewer knows real-VLM coverage was dropped, not deferred.

Strengths

  • The repaired assertions were checked against the source, not loosened. Schema v4 matches memory_store.py:650 (skill_deltas), the /api/connectors shape matches connectors.py:558 + :509-513, the three REQUIRED_CONNECTORS entries match agent.py:758-786, and _TOOL_REGISTRY is exactly what docs/sdk/testing.mdx:24-31 tells SDK users to do now that execute_tool() is gone.
  • assert resp.status_code in (200, 501) — a test that couldn't fail — is replaced by two tests that pin real behaviour (503 without a registered consolidator, and the consolidator's result and arguments when one is registered).
  • Allowlist entries carry a per-file reason naming the specific blocker, and two entries say plainly that the file is broken today rather than quietly parking it. check_test_lanes() also mirrors the existing check_workflow_triggers wiring exactly, including the is_warning=False blocking flag.

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.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

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 tests/test_ui_email_scope_consent.py but wasn't triggered by it, so a PR editing only that file still ran it nowhere — the exact blind spot this PR closes, surviving inside the PR that closes it. Now listed in both paths: blocks.

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 details

Gate after the merge: [OK] 879 test file(s) across 7 root(s) are all named by a lane or allowlisted (78 workflow file(s) scanned, 19 allowlisted). python util/lint.py --test-lanes passes.

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:

  • test_sdk.py::TestMCPComponents (x2) + test_all_imports_in_sdk_are_valid — my box has mcp==1.27.0, below the mcp>=2.0.0,<3.0 floor the lane installs.
  • test_clean_core_only_init_then_chat_journey, test_custom_agent_model_id_honored_through_api — Windows-only; the lane is ubuntu-latest.

test_list_knowledge_time_params_accepted now passes locally; test_tui_control_e2e.py is POSIX-only and skips on Windows, so the lane is its first real check.

Allowlist entry: tests/integration/test_lemonade_predownload_checks.py takes require_lemonade. It would skip cleanly in the offline lane rather than fail, but a whole-file skip reading as green is the blind spot the allowlist exists to document, so it is listed with a reason instead.

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. check_workflow_triggers already exists next door in util/lint.py and is the natural place to close it — worth a follow-up issue rather than scope creep into a PR that is already making a check blocking.

Unrelated red: the label job failed on HttpError: API rate limit exceeded for installation fetching .github/labeler.yml — infrastructure, not this diff.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 26, 2026
Merged via the queue into amd:main with commit 07188f5 Sep 26, 2026
36 of 37 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the claude/test-lane-blocking branch September 26, 2026 04:47
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Sep 26, 2026
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]>
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Sep 26, 2026
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]>
github-merge-queue Bot pushed a commit that referenced this pull request Sep 28, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: nine test files no CI lane runs are now failing; make the lane checker blocking

2 participants