GeezerVison is showing github.com — test(e2e): isolate prompt tests with per-worker backend by kitlangton · Pull Request #20464 · anomalyco/opencode
Conversation
kitlangton
commented
Apr 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- Spawn a dedicated backend process per Playwright worker so prompt e2e tests no longer share the dev server
- Add match-based queue routing to the mock LLM server (
pushMatch/textMatch/toolMatch) so canned responses target specific requests
- Extract shared mock OpenAI config into
e2e/prompt/mock.ts and thread serverUrl through all e2e helpers
- Deduplicate
withProject/withBackendProject fixtures into shared runProject helper
- Extract
assistantText polling helper used by both prompt specs
- Cap backend stdout/stderr log buffers
Shell refactor split to #20494.
Test plan
-
bun test:e2e -- prompt/prompt.spec.ts prompt/prompt-async.spec.ts — 3/3 pass
-
bun test:e2e:local -- e2e/prompt/ — passes (except prompt.spec which needs isolated backend)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ed LLM routing
Spawn a dedicated backend process per Playwright worker so prompt e2e
tests no longer share the dev server. Add match-based queue routing to
the mock LLM server so canned responses target specific requests (e.g.
title generation vs actual prompt). Extract shared mock OpenAI config
into e2e/prompt/mock.ts and thread serverUrl through all helpers.
The shell invocation had `-c` before `-l`, causing zsh/bash to treat
`-l` as the command string instead of the login flag. Also move the
close-event listener to immediately after spawn to prevent missing
the event if the process exits before the listener is attached.
Also simplifies e2e fixtures (dedup withProject/withBackendProject),
extracts assistantText helper, caps backend log buffers, and reverts
prompt-shell test to use withProject (no isolated backend needed).
The prior change moved the close-event listener before stdout/stderr
data handlers, which caused the process close to resolve before output
was collected. Revert to the original inline close handling inside
Effect.promise which correctly sequences data→close→finish.
Keep the -l/-c arg reorder (harmless — both orders work for zsh/bash)
and the new shell unit tests. Revert prompt-shell e2e to withProject
since it doesn't need the isolated backend.
kitlangton
changed the title
test(e2e): isolate prompt tests with per-worker backend
test(e2e): isolate prompt tests + refactor shell to Effect ChildProcess
Apr 1, 2026
Replace raw node:child_process spawn + manual event wiring with
Effect's ChildProcessSpawner. Stream output is collected via
Stream.runForEach for incremental metadata updates. Process cleanup
uses handle.kill with forceKillAfter for reliable SIGTERM→SIGKILL
escalation.
Drop manual .zshrc/.bashrc sourcing — use login shell (-l) which
loads .zshenv/.zprofile. Interactive rc files caused CWD changes
and output capture issues.
Fix cross-spawn-spawner kill() so forceKillAfter wraps the entire
send+wait-for-exit sequence, not just the signal send.
Shell changes moved to kit/shell-effect-childprocess (#20494).
kitlangton
changed the title
test(e2e): isolate prompt tests + refactor shell to Effect ChildProcess
test(e2e): isolate prompt tests with per-worker backend
Apr 1, 2026
Uh oh!
There was an error while loading. Please reload this page.
|
@kitlangton Side effects on non-prompt tests resulted in file-based tests being forced to use isolated backends with cold file indexes. Is this the intended behavior?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Rwanbt
pushed a commit
to Rwanbt/unifia
that referenced
this pull request
May 5, 2026
AIALRA-0
pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|