Skip to content

test(ci): consolidate integration test binaries and split monolithic cli_flow - #1951

Merged
eric8810 merged 2 commits into
mainfrom
eric/1934-consolidate-integration-test-binaries
Nov 21, 2026
Merged

eric8810 merged 2 commits into
mainfrom
eric/1934-consolidate-integration-test-binaries

Conversation

@eric8810

@eric8810 eric8810 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Consolidates multi-file integration test binaries across 13 workspace crates using autotests = false + explicit [[test]] suites, and splits the monolithic crates/dimcode/tests/cli_flow target into 4 balanced domain binaries.

Fixes #1934

Summary of changes

  1. Consolidate multi-file integration tests (129 → 29 integration test executables, -77.5%, 100 executables eliminated):

    • Used autotests = false + explicit [[test]] entries so existing test files remain at their current paths (preserving include_str! / fixture paths, scripts/ci-changes.mjs path rules, doc links, and git history):
      • dim-app-server: 24 → 3 (transport_flow, app_server_flow, and standalone provider_memory_flow which defines #[global_allocator])
      • dim-agent-integration-tests (tests/integration): 22 → 1 (integration_flow)
      • dim-agent-capabilities: 21 → 1 (capabilities_flow)
      • dim-agent-scheduler: 14 → 1 (scheduler_flow)
      • dim-goal: 7 → 1 (goal_suite)
      • dim-agent-types: 6 → 1 (agent_types_contract; frozen fixtures and *_contract.rs files untouched)
      • dim-session-title: 6 → 1 (session_title_flow)
      • dim-event-hub: 5 → 1 (hub_flow, preserving the CI target name)
      • dim-agent-runtime: 4 → 1 (agent_runtime_flow)
      • dim-modality-aimux: 3 → 1 (modality_aimux_flow)
      • dim-agent-aimux: 2 → 1 (agent_aimux_flow)
      • dim-modality: 2 → 1 (modality_suite)
      • dim-ocr: 2 → 1 (ocr_flow)
    • Deduplicated shared support / local_support / fixtures/mcp_host.rs modules to compile once per binary instead of once per test file, and removed now-obsolete #![expect(dead_code)] attributes where consolidation made all helpers live (dim-agent-capabilities, dim-event-hub/tests/support/mod.rs, tests/integration/tests/local_support/compaction.rs).
  2. Split monolithic crates/dimcode/tests/cli_flow (52,566 lines / 728 tests → 4 balanced targets):

    • Extracted the shared CLI/PTY/wire harness into crates/dimcode/tests/support/cli_harness.rs.
    • Split into 4 balanced test binaries (cli_flow: 234 tests, cli_tui_flow: 212 tests, cli_daemon_flow: 163 tests, cli_session_flow: 119 tests; exact 728/728 test preservation):
      • cli_flow retains all 12 CI --ignored production/line-mode flows (keeping scripts/tui-tmux.test.mjs and .github/workflows/ci.yml's ignored selection intact) as well as staged_update (avoiding merge conflict with build(ci): replace DIM_RELEASE_BUILD recompile loop with release-safe runtime injection #1949).
      • cli_tui_flow (144.0 MiB), cli_daemon_flow (199.1 MiB), and cli_session_flow (68.9 MiB) no longer link dim_app_server::serve and emit zero macOS ld: __eh_frame section too large linker warnings. (cli_flow still crosses the 16 MiB __eh_frame threshold on macOS debug solely because hooks::a_stop_hook_exports_its_session_from_dimcode_home embeds dim_app_server::serve in-process, matching the baseline threshold of dim-app-server itself.)
  3. CI, runner scheduling & documentation:

    • Updated scripts/run-rust-test.mjs longTargets to schedule transport_flow, cli_flow, cli_tui_flow, cli_session_flow, and cli_daemon_flow first.
    • Updated scripts/test-macos-native.mjs (and added a regression test in scripts/test-macos-native.test.mjs) to follow mod and #[path = "..."] declarations from Cargo target roots so consolidated autotests = false integration test suites resolve all macOS-native tests to their owning targets.
    • Updated .github/workflows/ci.yml target filters for the consolidated integration_flow (local_execution::...) and app_server_flow (mcp_http_flow::node_).
    • Updated --test commands in docs/architecture/build.md, docs/architecture/tui-e2e.md, crates/dim-app-server/README.md, and crates/dim-cli/README.md.

Measurements (macOS arm64 debug)

Metric Before After Delta
Integration test executables 129 29 -100 (-77.5%)
Total integration test binary footprint on disk ~31+ GiB (27.8 GiB mbx stored in run 44682086611) ~7.0 GiB (6.82 GiB + 199 MiB cli_daemon_flow / -127 MiB cli_session_flow delta) ~-77%
dimcode CLI flow targets 1 × 426.6 MiB (728 tests, single-process tail) 4 targets: 408.9 / 199.1 / 144.0 / 68.9 MiB (234 / 163 / 212 / 119 tests) Parallelized across 4 targets; 3/4 drop __eh_frame warning

Verification

  • cargo fmt --all -- --check --config error_on_line_overflow=true — passed
  • cargo clippy --workspace --all-targets --locked -- -D warnings — passed
  • cargo build --workspace --all-targets --locked — passed; confirmed all 29 integration test target names are globally unique
  • Full compiled workspace tests (run-rust-test.mjs --workspace --test-threads=3) plus rebalanced cli_session_flow (118/118, 52.8s) and cli_daemon_flow (160/160, 186.6s) — passed (app_server_flow 486/486, capabilities_flow 613/613, integration_flow 233/233, scheduler_flow 108/108, goal_suite 93/93, hub_flow 48/48, session_title_flow 25/25, agent_types_contract 47/47, agent_runtime_flow 33/33, agent_aimux_flow 77/77, modality_suite 82/82, modality_aimux_flow 25/25, ocr_flow 9/9)
  • Verified --list filter matching on every CI --ignored selection (integration_flow, cli_flow 12/12 + staged_update, app_server_flow 4/4, hub_flow 1/1, transport_flow)
  • target/debug/xtask check (all 8 checks) — passed
  • node scripts/adr-check.mjs --base origin/main — passed (105 changed files)
  • node --test scripts/test-macos-native.test.mjs scripts/tui-tmux.test.mjs scripts/ci-changes.test.mjs scripts/development.test.mjs — passed
  • node scripts/test-macos-native.mjs (full real macOS ARM64 native suite after rebasing onto ci: require full Linux verification and macOS-native checks on pull requests #1921 / build(rutis): upgrade the plugin runtime to 0.23 #1941) — passed across all 9 selected targets

Ablation review

  • Initially split dim-app-server into 4 binaries (storage_provider_flow + app_server_flow) and dim-agent-capabilities into 2 (capabilities_context_flow + capabilities_flow). Measurement showed each extra binary duplicated ~410 MiB (dim-app-server) / ~145 MiB (dim-agent-capabilities) of static dependencies without improving wall-clock parallelism (capabilities_flow ran in 40s total; app_server_flow ran in 162s vs transport_flow's 381s), so both extra binaries were ablated.
  • Kept provider_memory_flow standalone because it installs #[global_allocator], and kept transport_flow standalone because it is already 501 MiB / 683 tests / 381s.
  • All 3 support modules whose consolidation eliminated dead code had their #![expect(dead_code)] attributes removed; the remaining fixtures keep explicit #[allow(dead_code, reason = ...)] only where shared across multiple targets or retaining fixture hooks.

@eric8810
eric8810 force-pushed the eric/1934-consolidate-integration-test-binaries branch from 02a3b12 to 7b2b1e0 Compare November 20, 2026 11:51
@eric8810
eric8810 marked this pull request as ready for review November 20, 2026 11:52

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: request changes.

The consolidation is mechanically faithful. Every top-level test file in the 14 packages is reachable from exactly one target, the 29 target names are unique, and the cli split keeps the same 728 macOS tests (234 / 212 / 163 / 119) with the same function names and bodies as base 2537795. The CI selections survive too: the 12 named cli_flow ignored flows select 12 tests, app_server_flow selects 4 mcp_http_flow::node_ tests, hub_flow selects 1, and the integration_flow handoff filter selects 1.

P2: three re-exec probes stopped running

The wrapper turns file_storage_flow and host_platform_flow into modules, so their tests are now file_storage_flow::... and host_platform_flow::.... Three tests re-exec current_exe() with --exact and the old bare name: crates/dim-agent-capabilities/tests/file_storage_flow.rs:988-993 and :1211-1213, and crates/dim-agent-capabilities/tests/host_platform_flow.rs:187-193. With --exact those names match zero tests, libtest exits 0, and the parent assertion passes. On the built binary, --list --exact removal_scales_with_directory_size prints "0 tests" and the test passes in 0.01s. The 300-file RLIMIT_NOFILE removal, the cross-process lock check, and the shell cache detection no longer run, while the suite still reports 613 passes. Fix: use file_storage_flow::removal_scales_with_directory_size, file_storage_flow::file_storage_flow, and host_platform_flow::unchanged_shell_preferences_reuse_detection_and_edits_recover, and assert that the child ran one test so a future rename fails loudly.

Blocking merge state

Current main is ffd3e11 and GitHub reports CONFLICTING. Merge-tree against ffd3e11 conflicts in three files:

  • crates/dim-modality/tests/ocr_descriptors.rs: main now starts the file with #![cfg(target_os = "macos")]. This PR removes that line, and crates/dim-modality/tests/modality_suite.rs:4 includes the module under a unix-only suite. Resolving toward this side would run the macOS-only descriptor probe on Linux verify. Keep #[cfg(target_os = "macos")] on the module.
  • crates/dimcode/tests/cli_flow.rs: main added terminal.until("deferred output"); at line 8720 of approval_interrupt_stops_the_turn_instead_of_a_deferred_completed_shell. The moved copy at crates/dimcode/tests/cli_tui_flow.rs:3915 lacks it. Carry the wait when rebasing or the race fix is lost.
  • docs/architecture/build.md:322: main rewrote the same runner paragraph. Keep main's text and add the five-target start list.

PR #1949 merges cleanly with this head in a merge-tree check. PR #1915 and PR #1306 add new top-level test files under crates/dim-agent-capabilities/tests and crates/dim-app-server/tests; after this lands they need entries in capabilities_flow.rs and app_server_flow.rs, otherwise the tests will not run.

P3: tui-e2e target counts

docs/architecture/tui-e2e.md:375,377-378,409,421-425 still attributes 283 TUI cases and 400 non-TUI cases to the cli_flow target, which now holds 234 tests (13 ignored). The TUI cases are in cli_tui_flow; the daemon and session cases are in cli_daemon_flow and cli_session_flow. The command at line 29 was updated, the counts were not. Use cli_flow* or give per-target numbers.

Optional, pre-existing: crates/dim-cli/README.md:1788 runs cargo test -p dim-cli --test cli_flow; dim-cli has no such target. Use -p dimcode.

Verified

  • Static #[test] counts per package are identical at base 2537795 and head. The cli files hold 738 attributes, 728 on macOS after the three cfg(target_os = "linux") cases.
  • Built capabilities_flow (616 listed, 613 default), app_server_flow (493, 486 default), transport_flow (683), provider_memory_flow (1), and the four cli targets (234 / 212 / 119 / 163). The four cli targets have 728 unique names with no overlap.
  • Focused tests from all four cli targets plus app_server_flow, scheduler_flow, integration_flow, and goal_suite pass.
  • fmt, cargo run -p xtask -- check (8 checks), node scripts/adr-check.mjs --base origin/main, and the three named Node tests (23/23) pass. cargo clippy -D warnings passes for capabilities, event-hub, scheduler, goal, integration, and modality.
  • CI: changes, dependencies, web, windows-cli pass; verify is queued.

Unverified

Full workspace build and default test runs of all four cli targets and every consolidated suite; full workspace clippy; Windows and Linux builds; the three Linux-only cases.

Withdrawn

None. This is the first review.

mod dispatch_flow;
mod faces_flow;
#[cfg(any(unix, windows))]
mod file_storage_flow;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making file_storage_flow a module renames its tests to file_storage_flow::.... crates/dim-agent-capabilities/tests/file_storage_flow.rs:988-993 and :1211-1213 re-exec current_exe() with --exact and the bare names removal_scales_with_directory_size and file_storage_flow. Those filters now match zero tests, libtest exits 0, and the parent assertion passes, so both probes are skipped. On the built binary --list --exact removal_scales_with_directory_size prints 0 tests and the test passes in 0.01s. Pass the qualified names and assert the child ran one test.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{"comment_id":4642233908,"body":"Fixed in 76059f7."}
{"comment_id":4642233921,"body":"Fixed in 76059f7."}
{"comment_id":4642233930,"body":"Fixed in 76059f7."}
{"comment_id":4642233936,"body":"Fixed in 76059f7."}
{"comment_id":4642233943,"body":"Fixed in 76059f7."}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 23ab958.

mod hooks_flow;
mod host_flows;
#[cfg(unix)]
mod host_platform_flow;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same failure for host_platform_flow: crates/dim-agent-capabilities/tests/host_platform_flow.rs:187-193 re-execs with --exact unchanged_shell_preferences_reuse_detection_and_edits_recover, which no longer matches host_platform_flow::unchanged_shell_preferences_reuse_detection_and_edits_recover. The child runs 0 tests and the parent passes without exercising shell detection. Use the qualified name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 76059f7.

#![cfg(unix)]

mod modality_flow;
mod ocr_descriptors;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current main gates ocr_descriptors.rs with #![cfg(target_os = "macos")]. This module entry is only covered by the suite's #![cfg(unix)], so resolving the merge conflict toward this side would run the macOS-only descriptor probe on Linux verify. Add #[cfg(target_os = "macos")] to this module.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 76059f7.

terminal.until("Allow once? [y/N] ");
assert!(!terminal.transcript.contains("deferred output"));
terminal.signal(libc::SIGINT);
terminal.until("[stopping] Waiting for resource settlement");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current main added terminal.until("deferred output"); after this line in the original test (main line 8720). The moved copy goes straight to the second SIGINT, so taking this side when rebasing loses the race fix. Add the wait here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 76059f7.

Comment thread docs/architecture/build.md Outdated
CI and `./dev check` run the format check as `cargo fmt --all -- --check --config error_on_line_overflow=true`: when one line in a block cannot fit `max_width`, rustfmt abandons the block without a diagnostic, so the option turns that otherwise-skipped line into a failure ([#1769](https://github.com/arcships/dim/issues/1769)).

The macOS `verify` job has a seventy-five-minute overall deadline and allows four concurrent Cargo build jobs. It builds all workspace targets once, checks the architecture, then runs up to three recorded test executables at a time with up to three test threads per executable. The workspace run starts `transport_flow` and `cli_flow` first. The separate CLI profile and Node- and Python-backed Rust suites use two test threads each. The `dependencies` job allows two Cargo build jobs when installing `cargo-deny`.
The macOS `verify` job has a seventy-five-minute overall deadline and allows four concurrent Cargo build jobs. It builds all workspace targets once, checks the architecture, then runs up to three recorded test executables at a time with up to three test threads per executable. The workspace run starts `transport_flow`, `cli_flow`, `cli_tui_flow`, `cli_session_flow` and `cli_daemon_flow` first. The separate CLI profile and Node- and Python-backed Rust suites use two test threads each. The `dependencies` job allows two Cargo build jobs when installing `cargo-deny`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current main rewrote this paragraph for the Linux and macos-native jobs. Merge both: keep main's runner description and add cli_tui_flow, cli_session_flow, and cli_daemon_flow to the start list.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 76059f7.


A migrated case in `crates/dimcode/tests/cli_flow*` runs only here: it is
`#[ignore]`d, and `cargo test -p dimcode --test cli_flow -- --ignored` runs it
`#[ignore]`d, and `cargo test -p dimcode --test cli_flow --test cli_tui_flow --test cli_session_flow --test cli_daemon_flow -- --ignored` runs it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command now covers four targets, but the counts below still attribute everything to cli_flow: line 375 (283 TUI cases), line 377 (412 cases), line 421 (400 non-TUI cases). cli_flow now holds 234 tests; the TUI cases are in cli_tui_flow, and the daemon and session cases are in cli_daemon_flow and cli_session_flow. Update the counts to cli_flow* or per target.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 76059f7.

@eric8810
eric8810 force-pushed the eric/1934-consolidate-integration-test-binaries branch from 7b2b1e0 to b3fa9ff Compare November 20, 2026 12:09
Consolidate multi-file integration tests across 13 workspace crates
using `autotests = false` and explicit `[[test]]` suite entries so
existing test files remain at their paths while reducing total
integration test executables from 129 to 29 (-77.5%, ~77% smaller
compiled binary footprint).

Split the monolithic `crates/dimcode/tests/cli_flow` (52.5k lines,
728 tests) into four balanced domain binaries (`cli_flow`,
`cli_tui_flow`, `cli_daemon_flow`, `cli_session_flow`) sharing
`crates/dimcode/tests/support/cli_harness.rs`, keeping all 12 CI
ignored production flows and `staged_update` inside `cli_flow`.

Update `scripts/run-rust-test.mjs` long-target scheduling,
`.github/workflows/ci.yml` target filters, and verification commands
in architecture and crate docs.

Fixes #1934

# Conflicts:
#	crates/dim-modality/tests/ocr_descriptors.rs
#	crates/dimcode/tests/cli_flow.rs
#	docs/architecture/build.md
@eric8810
eric8810 force-pushed the eric/1934-consolidate-integration-test-binaries branch from b3fa9ff to 76059f7 Compare November 20, 2026 12:19
@eric8810

Copy link
Copy Markdown
Collaborator Author

Great catch on the three current_exe() + --exact probes! Addressed every finding and rebased onto origin/main (ffd3e1162):

  • P2 (three self-re-exec probes in dim-agent-capabilities): Updated the --exact filter names to file_storage_flow::removal_scales_with_directory_size, file_storage_flow::file_storage_flow, and host_platform_flow::unchanged_shell_preferences_reuse_detection_and_edits_recover, and asserted stdout.contains("1 passed;") on each child run so a future rename fails loudly instead of silently passing with 0 tests. Also audited every other current_exe() call under crates/*/tests/ and tests/ — none of the others pass bare test names.
  • Rebase onto origin/main (ffd3e1162):
    • Kept #[cfg(target_os = "macos")] on mod ocr_descriptors; in crates/dim-modality/tests/modality_suite.rs so it stays macOS-only.
    • Carried terminal.until("deferred output"); into crates/dimcode/tests/cli_tui_flow.rs (approval_interrupt_stops_the_turn_instead_of_a_deferred_completed_shell).
    • Kept main's runner description in docs/architecture/build.md with the five-target start list.
    • Updated scripts/test-macos-native.mjs (plus a regression test in scripts/test-macos-native.test.mjs) to walk mod and #[path = "..."] declarations from Cargo target roots so consolidated autotests = false suites resolve all macOS-native tests to their owning targets.
  • P3 & optional docs: Updated docs/architecture/tui-e2e.md aggregate count lines to cli_flow* (keeping the 12 --ignored production flows attributed to cli_flow), and fixed the pre-existing -p dim-cli typo in crates/dim-cli/README.md:1788 to -p dimcode.

Re-verified locally:

  • cargo test --locked -p dim-agent-capabilities --test capabilities_flow -- file_storage_flow::removal_scales_with_directory_size file_storage_flow::file_storage_flow host_platform_flow::unchanged_shell_preferences_reuse_detection_and_edits_recover --exact (3/3 passed, each asserting 1 passed; in the re-exec child)
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo fmt --all -- --check --config error_on_line_overflow=true
  • node scripts/test-macos-native.mjs (all 9 macOS-native targets built, uniquely resolved, and passed on Apple Silicon)
  • node --test scripts/test-macos-native.test.mjs scripts/tui-tmux.test.mjs scripts/ci-changes.test.mjs and node scripts/adr-check.mjs --base origin/main

Ready for re-review!

@eric8810
eric8810 requested a review from yyhhyyyyyy November 20, 2026 12:19

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: approve.

The consolidation preserves every test, and the round-1 blockers are fixed. At 76059f7 the 14 packages declare 21 unique test targets; cli_flow splits into cli_flow, cli_tui_flow, cli_session_flow and cli_daemon_flow.

Round-1 P2 fixed

All three re-exec probes pass module-qualified names and assert the child ran one test:

  • crates/dim-agent-capabilities/tests/file_storage_flow.rs:991 and :1001 (file_storage_flow::removal_scales_with_directory_size, 1 passed;).
  • crates/dim-agent-capabilities/tests/file_storage_flow.rs:1213 and :1224 (file_storage_flow::file_storage_flow, 1 passed;).
  • crates/dim-agent-capabilities/tests/host_platform_flow.rs:190 and :204 (host_platform_flow::unchanged_shell_preferences_reuse_detection_and_edits_recover, 1 passed;).

On the built capabilities_flow binary the old bare names list 0 tests and each qualified name lists 1. I ran the three tests; all pass in 7.6 s, 0.4 s and 0.03 s.

No other probe or filter has the module-prefix problem. The transport_flow probes at crates/dim-app-server/tests/transport_flow/workflow.rs:389, crates/dim-app-server/tests/transport_flow/workflow_reports.rs:289 and crates/dim-app-server/tests/transport_flow/worktrees.rs:880 match 1 test each in the built binary, as does runtime_manager::runtime_switches_from_system_to_downloaded_node. The --list probes in crates/dim-app-server/tests/storage_flow.rs:5293 and crates/dim-app-server/tests/transport_flow/reload.rs:191 do not filter by name.

Conflicts resolved with both sides

  • crates/dim-modality/tests/modality_suite.rs:4-5 gates ocr_descriptors with #[cfg(target_os = "macos")]; the file matches main except for the removed inner attribute.
  • crates/dimcode/tests/cli_tui_flow.rs:3916 carries terminal.until("deferred output");, and the whole test body is byte-identical to main's copy.
  • docs/architecture/build.md:322 keeps main's runner description and adds the five-target start list, matching scripts/run-rust-test.mjs:16.

Preservation and selections

  • Built binaries: cli_flow 234, cli_tui_flow 212, cli_daemon_flow 163, cli_session_flow 119, 728 total, 30 ignored, with no name overlap between targets.
  • Comparing main against the head over all 14 consolidated packages found every test name and attribute preserved. The only body changes are the three probe bodies and nine picker_page qualification edits, for example crates/dimcode/tests/cli_tui_flow.rs and crates/dimcode/tests/cli_flow/accounts.rs:224.
  • Every top-level tests/*.rs in the 14 autotests = false packages is reachable from a declared target; the workspace has 29 unique test target names.
  • CI selections: the 12 named cli_flow flows select 12 tests; staged_update::recovery:: selects 3 and staged_update::tui_update:: selects 2; integration_flow local_execution::a_long_foreground_command_moves_to_the_background_after_30_seconds exists and is ignored; transport_flow node_ selects 91, app_server_flow mcp_http_flow::node_ selects 4, hub_flow node_ selects 1.
  • The round-1 P3s are fixed: docs/architecture/tui-e2e.md:376,378-381,411,423 now says cli_flow*, and crates/dim-cli/README.md:1768,1788 uses -p dimcode and the four targets.

Verification

  • cargo fmt --all -- --check --config error_on_line_overflow=true: pass.
  • cargo run --locked -p xtask -- check: 8 checks pass.
  • node scripts/adr-check.mjs --base origin/main: pass, 105 changed files.
  • node --test scripts/*.test.mjs: 155 pass, 4 skipped, including the new consolidated-autotests discovery test.
  • node scripts/test-macos-native.mjs --list: resolves every consolidated target without an ambiguous test name.
  • Focused tests from all four cli targets, including approval_interrupt_stops_the_turn_instead_of_a_deferred_completed_shell, plus app_server_flow and transport_flow samples: pass.

CI

At 76059f7: changes, dependencies, web, windows-cli and macos-native pass; verify (linux) is queued; acp-registry is skipped.

Optional (P3, not blocking)

  • docs/design/appserver/model-log.md:100 still names cli_flow::recording_on_switches_the_model_log. The test moved to cli_tui_flow (crates/dimcode/tests/cli_tui_flow.rs:7793), so cargo test -p dimcode --test cli_flow recording_on_switches_the_model_log selects 0 tests and reports success.
  • PR #1915 and PR #1306 add crates/dim-agent-capabilities/tests/progress_reminder_flow.rs and crates/dim-app-server/tests/websocket_link.rs. With autotests = false, a new top-level test file that is not added to a wrapper is not compiled and its tests silently do not run. A note in AGENTS.md or an xtask check would make that requirement visible.

Unverified

  • verify (linux) was still queued. Full workspace clippy and the Linux and Windows default runs of the consolidated suites were not run locally.

Withdrawn

None. The six round-1 findings are fixed, not withdrawn.

…-integration-test-binaries

# Conflicts:
#	crates/dimcode/tests/cli_flow.rs
@eric8810

Copy link
Copy Markdown
Collaborator Author

Merged main to pick up #1958 and ported its wait-order fix into cli_tui_flow.rs, where this split moved the model-reselection and subagent-policy tests. All three affected tests pass locally (7.9s / 11.4s / 8.0s).

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: approve.

23ab958 is a merge of dbbd707 into 76059f7, not a rebase. Every approved blob is preserved. The only PR files that differ from 76059f7 are the four files where main changed the same content, and each difference is main's change applied to the split copy.

Merge resolution

  • crates/dimcode/tests/cli_flow/goal.rs:485-486 has the #1958 wait order (test / model before ⏵⏵ Workspace write) and is byte-identical to main.
  • crates/dimcode/tests/cli_tui_flow.rs:1951-1952 and :7191-7204 carry #1958's second test / model · high wait and the save-notice wait_for. The function bodies match main except for picker_page instead of models::picker_page, which is the split's intended qualification. I ran both tests, they pass.
  • docs/architecture/build.md:421 keeps #1895's catalog-sync paragraph and :322 keeps the PR's five-target start list.
  • crates/dim-agent-scheduler/tests/session_flow.rs:5 is main plus the PR's use crate::support;.
  • Outside the PR's 105 files, HEAD equals dbbd707. No approved file was added or dropped, and git diff --check is clean.

Preservation at 23ab958

  • Built with cargo test --locked --no-run: cli_flow 234 tests and 13 ignored, cli_tui_flow 212 and 13, cli_daemon_flow 163 and 3, cli_session_flow 119 and 1. Total 728 and 30 ignored. No name repeats inside a target or across the four.
  • Built main's cli_flow at dbbd707: 728 tests and 30 ignored. The full name set and the ignored set are identical to the union of the four head targets, so nothing was lost or duplicated.
  • For the other 13 autotests = false packages, source comparison at main and HEAD found no added or lost test names in any package.
  • Every tests/*.rs in the 14 packages is reachable from a declared target. The only shared module is crates/dimcode/tests/support/cli_harness.rs, included by the four cli targets. tests/support/wakeup_pass.rs is reached from crates/dim-agent-scheduler/src/lib.rs:26.
  • Every removed file-level #![cfg] has the same gate on its wrapper mod, for example #[cfg(windows)] mod named_pipe_flow; at crates/dim-app-server/tests/app_server_flow.rs:17-18 and #[cfg(target_os = "macos")] mod ocr_descriptors; at crates/dim-modality/tests/modality_suite.rs:4-5.
  • The workspace has 29 test targets and 29 unique names. The 14 consolidated packages declare 21.

CI selections

  • The 12 named cli_flow flows at .github/workflows/ci.yml:232-245 all exist and are #[ignore]d. staged_update::recovery:: selects 3 and staged_update::tui_update:: selects 2 at :251-252.
  • integration_flow local_execution::a_long_foreground_command_moves_to_the_background_after_30_seconds at :209 exists and is ignored. I ran it, pass in 31.14 s.
  • transport_flow node_ selects 91, app_server_flow mcp_http_flow::node_ 4 and hub_flow node_ 1 at :269-272. transport_flow python_plugin_ selects 4 and runtime_manager::runtime_switches_from_system_to_downloaded_node exists.
  • scripts/run-rust-test.mjs:16 lists the same five start targets as docs/architecture/build.md:322.

Verification

  • cargo fmt --all -- --check --config error_on_line_overflow=true: pass.
  • xtask check: module, crate, plugin document, service, declaration, lock, comment link and literal main checks pass.
  • node scripts/adr-check.mjs --base origin/main: pass, 105 changed files.
  • node --test scripts/*.test.mjs: 159 tests, 155 pass, 4 skipped.
  • node scripts/test-macos-native.mjs --list: resolves every consolidated target.
  • The three re-exec probes pass on the built binary: crates/dim-agent-capabilities/tests/file_storage_flow.rs:990, :1213 and crates/dim-agent-capabilities/tests/host_platform_flow.rs:190.
  • Focused tests pass: goal::tui_goal_shows_the_state_and_marks_the_status_area, repicking_the_current_model_keeps_the_effort, tui_models_picker_edits_only_the_subagent_model_policy, a cli_daemon_flow sample, and cli_flow export_writes_the_timeline_without_starting_a_daemon with DIM_TEST_APP_SERVER.
  • Isolated HOME, TMPDIR, XDG and CARGO_TARGET_DIR under the data directory. No ~/.dimcode use and no leftover processes.

CI

At 23ab958: changes, dependencies, web, windows-cli and macos-native pass; acp-registry is skipped; verify (linux) and ci-ok fail. The failures are not from this PR.

  • 10 capabilities_flow confined-helper failures and 4 modality_suite OCR failures are bwrap: Can't mount proc on /newroot/proc: Operation not permitted. The same message appears in verify (linux) for #1950 and #1952 at the same time, and those PRs do not change these tests.
  • The other capabilities_flow failures are a branch_flow timeout, a file_storage_flow PermissionDenied at crates/dim-agent-capabilities/tests/file_storage_flow.rs:1242 and a permission_flow worktree timeout. transport_flow fails at execution_settings::execution_settings_decide_the_next_process_boundary, the same test that fails on #1950 and #1952. All are timing or runner-permission failures in files this PR does not change.
  • 30 xtask scenario_eval child-hook failures also appear in #1950, #1952 and the 76059f7 run.
  • The cli suites pass on Linux at this head: cli_flow 221 passed and 13 ignored, cli_tui_flow 200 and 13, cli_daemon_flow 161 and 3, cli_session_flow 118 and 1. At 76059f7 the goal and picker tests failed; this merge fixes them.

Conflicts with open PRs

  • #1949 conflicts only in docs/architecture/tui-e2e.md. Resolve with #1949's 287, 291, 417, 405 and 6 staged-update cases plus this PR's cli_flow* naming and four-target command.
  • #1952 conflicts in .github/workflows/ci.yml and docs/architecture/build.md. Keep #1952's scheduled-sweep wording and migration_flow removal plus this PR's integration_flow local_execution::... and app_server_flow rename.
  • #1953 conflicts in .github/workflows/ci.yml, crates/dimcode/tests/cli_flow.rs, docs/architecture/build.md and scripts/run-rust-test.mjs. Keep #1953's larger longTargets union and its thread variables on the renamed app_server_flow mcp_http_flow::node_ line. A resolution that keeps #1953's mcp_http_flow node_ line will fail because that target no longer exists.
  • #1950 merges clean.

Optional (P3, not blocking)

  • docs/architecture/tui-e2e.md:380 and :423 still say 412 cases and 400 non-TUI cases. The four targets hold 728 tests, 698 default and 30 ignored. The numbers were already stale on main, whose cli_flow binary lists 728, and this PR now applies them to cli_flow*. Recompute them or point to the per-target counts.
  • docs/design/appserver/model-log.md:100 still names cli_flow::recording_on_switches_the_model_log. The test is at crates/dimcode/tests/cli_tui_flow.rs:7804, so the documented selection runs 0 tests and passes.
  • #1915 and #1306 add crates/dim-agent-capabilities/tests/progress_reminder_flow.rs and crates/dim-app-server/tests/websocket_link.rs. With autotests = false, those files will not compile unless their wrappers gain a mod line. A note in AGENTS.md or an xtask check would make the requirement visible.

Unverified

  • Windows compilation of the #[cfg(windows)] modules and the Windows-specific test paths. PR CI's windows-cli job only builds dim-cli --lib.
  • A full local Linux run of the consolidated suites. I verified the selections against the built macOS binaries and used the Linux CI log for execution.
  • The other 11 named ignored production flows were not executed locally; each name and ignore state was verified in the binary.

Withdrawn

None. The six round-1 threads remain fixed at this head, and the round-1 target-name finding for tui-e2e.md is closed. Only the count detail above remains optional.

The `cli_flow` target also holds the line-mode, ACP, daemon and production flows
The `cli_flow*` targets (`cli_flow`, `cli_tui_flow`, `cli_daemon_flow`,
`cli_session_flow`) also hold the line-mode, ACP, daemon and production flows
that CI keeps: 412 cases, of which 400 run by default and 12 are `--ignored`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3, optional. These counts still describe main's single cli_flow target. At 23ab958 the four targets hold 234 + 212 + 163 + 119 = 728 tests, 698 default and 30 ignored, so 412 and 400 no longer describe cli_flow*; line 423 repeats the 400. A reader planning CI time or coverage from this page gets the wrong number. Recompute both lines or replace them with a pointer to the per-target cargo test -- --list counts.

@eric8810
eric8810 merged commit c689a17 into main Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test/ci: consolidate 129 integration test binaries and split monolithic cli_flow to stop mbx cache thrashing

2 participants