GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Run CLI subprocess tests concurrently (#28399) · BlueBlock/opencode@a8f7c5e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/test
    • cli/run
      • run-process.test.ts
    • lib
      • cli-process.ts
  • perf
    • test-suite.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/test/cli/run/run-process.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/cli/run/run-process.test.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { cliIt } from "../../lib/cli-process"
1010
describe("opencode run (non-interactive subprocess)", () => {
1111
// Happy path: prompt completes, output reaches stdout, process exits 0.
1212
// If this fails, all the others likely will too — debug here first.
13-
cliIt.live(
13+
cliIt.concurrent(
1414
"exits 0 and writes the response to stdout on a successful prompt",
1515
({ llm, opencode }) =>
1616
Effect.gen(function* () {
@@ -27,7 +27,7 @@ describe("opencode run (non-interactive subprocess)", () => {
2727
// makes the SDK call surface an error promptly so the process exits nonzero.
2828
// We assert nonzero exit AND wall-clock under the harness timeout — a hang
2929
// would expire the timeout and produce a different (signal-killed) failure.
30-
cliIt.live(
30+
cliIt.concurrent(
3131
"exits nonzero promptly when the model is unknown (regression for #27371)",
3232
({ opencode }) =>
3333
Effect.gen(function* () {
@@ -47,7 +47,7 @@ describe("opencode run (non-interactive subprocess)", () => {
4747
//
4848
// This is debatable — a future cleanup might flip it to exit 1. If you're
4949
// changing this expectation, do it deliberately and say so in the PR.
50-
cliIt.live(
50+
cliIt.concurrent(
5151
"mid-stream LLM error still exits 0 today (contract lock-in)",
5252
({ llm, opencode }) =>
5353
Effect.gen(function* () {
@@ -61,7 +61,7 @@ describe("opencode run (non-interactive subprocess)", () => {
6161
// --format json puts one JSON object per line on stdout for each emitted
6262
// event. Consumers (CI scripts, tooling) parse this stream. Asserts the
6363
// shape so a future event-emit change has to update this expectation.
64-
cliIt.live(
64+
cliIt.concurrent(
6565
"--format json emits parseable line-delimited JSON to stdout",
6666
({ llm, opencode }) =>
6767
Effect.gen(function* () {
Collapse file

‎packages/opencode/test/lib/cli-process.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/lib/cli-process.ts
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// builders (`opencode.serve(opts)`, `opencode.acp(opts)`, `opencode.auth(...)`)
1818
// without changing the fixture. Long-lived commands like `serve` will need a
1919
// different return shape — see the TODO at the bottom of OpencodeCli.
20-
import type { TestOptions } from "bun:test"
20+
import { test, type TestOptions } from "bun:test"
2121
import { AppFileSystem } from "@opencode-ai/core/filesystem"
2222
import { AppProcess } from "@opencode-ai/core/process"
2323
import { Deferred, Duration, Effect, Layer, Queue, Scope, Stream } from "effect"
@@ -439,9 +439,9 @@ function expectExit(result: RunResult, expected: number, label = "opencode") {
439439
// `it.live(name, () => withCliFixture(fixture))` — one fewer nesting level at
440440
// every call site. Use this for any test that needs the opencode CLI fixture.
441441
//
442-
// Only `.live` is exposed because subprocess tests must run against the real
443-
// clock — a TestClock-paused environment can't drive a child process. If you
444-
// need `.only` or `.skip`, fall back to `it.live` + `withCliFixture` directly.
442+
// Subprocess tests must run against the real clock — a TestClock-paused
443+
// environment can't drive a child process. If you need `.only` or `.skip`, fall
444+
// back to `it.live` + `withCliFixture` directly.
445445
// Body's R is `Scope.Scope | never` so tests can yield* scope-requiring
446446
// resources (e.g. `opencode.serve`) without an extra `Effect.scoped` wrapper —
447447
// `withCliFixture`'s outer scope is the natural lifetime.
@@ -451,4 +451,9 @@ export const cliIt = {
451451
body: (input: CliFixture) => Effect.Effect<A, E, Scope.Scope | HttpClient.HttpClient>,
452452
opts?: number | TestOptions,
453453
) => it.live(name, () => withCliFixture(body), opts),
454+
concurrent: <A, E>(
455+
name: string,
456+
body: (input: CliFixture) => Effect.Effect<A, E, Scope.Scope | HttpClient.HttpClient>,
457+
opts?: number | TestOptions,
458+
) => test.concurrent(name, () => Effect.runPromise(Effect.scoped(withCliFixture(body))), opts),
454459
}
Collapse file

‎perf/test-suite.md‎

Copy file name to clipboardExpand all lines: perf/test-suite.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Repeated setup work, long sleeps/timeouts, serial integration tests, filesystem/
8484
| Remaining legacy tools config cases can use Effect-aware instance fixtures | Migrated allow/deny legacy `tools` permission cases to `it.instance` | 2.65s | 1.90s | keep | Single baseline before edit; after median from three sequential reruns (2.58, 1.90, 1.90). |
8585
| Oversized snapshot batch tests only need to cross the 100-file boundary | Reduced large diff/revert fixture sizes while keeping each case above the batch boundary | 4.32s | 3.66s | keep | Three affected snapshot tests; after median from three reruns (4.32, 3.66, 3.66) while still crossing the 100-file boundary. |
8686
| Prompt tests without LLM calls do not need the test LLM server | Added a no-server runner and moved obvious non-LLM prompt/shell cases to it | 25.41s | 21.03s | keep | Full prompt file after simplify pass median from three reruns (20.66, 21.03, 21.64); LLM-backed tests stay on original runner. |
87+
| CLI run subprocess cases can run independently | Marked `run-process.test.ts` subprocess cases concurrent | 11.87s | 4.13s | keep | Newest-dev single baseline; after median from three reruns (4.13, 4.17, 4.11). Each case has an isolated temp home and LLM port. |
8788

8889
## Profiling Results
8990

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.