cloudaxe-opencode/packages/opencode/test
Kit Langton 5bc6a7f6d0 test(cli): opt-in pre-built binary for ~3x faster subprocess spawns
\`bun run --conditions=browser src/index.ts\` pays ~15s of JIT + plugin
init + DB migration per subprocess spawn in isolation mode. A pre-built
binary cuts that to ~5s — most of which is now the SQLite \`:memory:\`
migration that runs regardless of execution mode.

Adds \`script/prebuild-test-cli.ts\` which wraps the existing build.ts
with \`--single --skip-embed-web-ui --skip-install\`, then symlinks the
platform-specific output to \`dist/test-cli/bin/opencode\` so the
harness has a stable path.

The harness (test/lib/cli-process.ts) reads OPENCODE_TEST_CLI_PATH and
spawns the binary directly when set; falls back to dev mode otherwise.
Strictly opt-in — default behavior, CI, and local iteration are
unchanged. Anyone who wants the speedup runs:

  bun script/prebuild-test-cli.ts
  export OPENCODE_TEST_CLI_PATH="\$PWD/dist/test-cli/bin/opencode"
  bun test test/cli/

Measured locally:
  Dev mode (default):  29.9s  (331 tests)
  Binary mode:         22.1s  (-26%, after one-time 2.8s build)

The win compounds as more subprocess tests are added — every new test
that hits DB migration saves ~10s vs dev mode.
2026-05-19 11:36:15 -04:00
..
account refactor: remove module barrels (#24554) 2026-04-27 14:33:33 -04:00
acp chore: generate 2026-05-14 23:34:42 +00:00
agent refactor(flags): route scout through runtime flags (#27318) 2026-05-13 17:07:53 +05:30
auth core: move cross-spawn-spawner to root and remove unused types 2026-04-25 14:30:16 -04:00
background feat(core): add background job service (#27033) 2026-05-12 15:22:38 +05:30
bus fix(bus): acquire PubSub subscription eagerly to close /event race (#27959) 2026-05-18 11:38:05 -04:00
cli test(cli): tier-A read-only command smoke tests (#28274) 2026-05-19 11:35:48 -04:00
config test: migrate plugin config fixtures 2026-05-18 22:14:01 -04:00
control-plane Speed up targeted opencode tests 2026-05-18 16:18:29 +00:00
effect chore: generate 2026-05-18 18:42:55 +00:00
fake test(agent): isolate plugin agent regression (#26948) 2026-05-11 19:38:54 -04:00
file Stabilize watcher test readiness (#28194) 2026-05-18 12:51:46 -04:00
filesystem refactor: rename shared package to core (#24309) 2026-04-25 10:59:17 -04:00
fixture use keymap state for layer visibility (#26246) 2026-05-19 17:07:26 +02:00
fixtures/recordings/session chore: generate 2026-05-19 12:21:56 +00:00
format test(format): remove formatter check sleeps (#27407) 2026-05-13 21:02:34 -04:00
git test(git): migrate git tests to Effect runner (#27121) 2026-05-12 18:50:07 +00:00
ide
image fix: image resizer wasm loading, reenable image resizing (#26805) 2026-05-13 23:06:07 -05:00
installation effect(installation): migrate to AppProcess.run (#27188) 2026-05-13 11:54:29 -04:00
lib test(cli): opt-in pre-built binary for ~3x faster subprocess spawns 2026-05-19 11:36:15 -04:00
lsp fix(lsp): preserve instance ref for update events (#28016) 2026-05-17 16:37:00 +05:30
mcp test(lib): promote pollWithTimeout/awaitWithTimeout helpers (#27626) 2026-05-14 23:45:32 +00:00
patch effect(patch,tool): migrate patch/index and tool/read to AppFileSystem (#27155) 2026-05-13 20:32:19 -04:00
permission chore: generate 2026-05-13 02:08:16 +00:00
plugin Speed up targeted opencode tests 2026-05-18 16:18:29 +00:00
project refactor(instance): remove legacy runtime fallback (#27757) 2026-05-15 23:05:44 +05:30
provider Migrate provider lookup tests to instance fixtures 2026-05-18 18:01:53 +00:00
pty test(pty): migrate output isolation to Effect runner (#27235) 2026-05-13 03:25:52 +00:00
question refactor(instance): remove legacy runtime fallback (#27757) 2026-05-15 23:05:44 +05:30
reference refactor(repository): add cache service (#28184) 2026-05-18 21:25:38 +05:30
server fix(httpapi): preserve v2 openapi errors (#28298) 2026-05-19 11:42:01 +05:30
session chore: generate 2026-05-19 12:21:56 +00:00
share refactor: remove module barrels (#24554) 2026-04-27 14:33:33 -04:00
shell refactor: remove module barrels (#24554) 2026-04-27 14:33:33 -04:00
skill refactor(flags): migrate external skills flag (#27685) 2026-05-15 13:24:56 +05:30
snapshot test: use Effect file services in migrated tests (#27154) 2026-05-12 20:48:07 +00:00
storage refactor(flags): migrate skip migrations flag (#27705) 2026-05-15 14:54:29 +05:30
sync refactor(sync): publish via EffectBridge.fork for codebase consistency (#28187) 2026-05-18 13:30:41 -04:00
tool chore: generate 2026-05-19 15:11:40 +00:00
util refactor(repository): clarify reference domain (#28182) 2026-05-18 21:04:44 +05:30
v2 Add Effect-native core event system (#27415) 2026-05-15 00:50:23 +00:00
AGENTS.md refactor(instance): remove legacy runtime fallback (#27757) 2026-05-15 23:05:44 +05:30
EFFECT_TEST_MIGRATION.md refactor(instance): retire WithInstance adapter (#27782) 2026-05-16 01:30:07 +05:30
permission-task.test.ts test: migrate permission task config tests (#27343) 2026-05-13 14:56:26 +00:00
preload.ts refactor(flags): route session workspaces through runtime flags (#27335) 2026-05-13 20:14:40 +05:30