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 — test(e2e): isolate prompt tests with per-worker backend by kitlangton · Pull Request #20464 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Apr 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@kitlangton
test(e2e): isolate prompt tests with per-worker backend and match-bas…
8116e83
…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.
@github-actions github-actions Bot added contributor Vouched labels Apr 1, 2026
kitlangton added 2 commits April 1, 2026 10:04
@kitlangton
fix(shell): correct arg order for zsh/bash and fix close-event race
1d26fad
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).
@kitlangton
fix(shell): revert race-condition fix that broke stdout capture
fa66fc6
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
kitlangton force-pushed the kit/e2e-isolated-backend branch from 89b151b to 6944db8 Compare April 1, 2026 15:11
@kitlangton 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
@kitlangton kitlangton added the beta label Apr 1, 2026
@kitlangton
kitlangton force-pushed the kit/e2e-isolated-backend branch 3 times, most recently from 29adc0a to e1c29c9 Compare April 1, 2026 15:40
@kitlangton
refactor(shell): use Effect ChildProcess for shell command execution
4576a00
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.
@kitlangton
kitlangton force-pushed the kit/e2e-isolated-backend branch from e1c29c9 to 4576a00 Compare April 1, 2026 15:43
@kitlangton
chore: remove shell refactor from e2e branch
6fb8045
Shell changes moved to kit/shell-effect-childprocess (#20494).
@kitlangton 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
@kitlangton
kitlangton marked this pull request as ready for review April 1, 2026 15:52
@kitlangton
kitlangton requested a review from adamdotdevin as a code owner April 1, 2026 15:53
@kitlangton
kitlangton enabled auto-merge (squash) April 1, 2026 15:53
@kitlangton
kitlangton merged commit 38d2276 into dev Apr 1, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kitlangton
kitlangton deleted the kit/e2e-isolated-backend branch April 1, 2026 15:58
jeromelau pushed a commit to jeromelau/opencode that referenced this pull request Apr 2, 2026
@kitlangton liuzeming
test(e2e): isolate prompt tests with per-worker backend (anomalyco#20464
77fa5ac
)
@chenyy9527

chenyy9527 commented Apr 10, 2026

Copy link
Copy Markdown

@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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@achin90 achin90 mentioned this pull request Apr 10, 2026
DispatchTUI prtest achin90/Dispatch#3
Closed
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
@kitlangton
test(e2e): isolate prompt tests with per-worker backend (anomalyco#20464
b683e66
)
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@kitlangton
test(e2e): isolate prompt tests with per-worker backend (anomalyco#20464
5b397e7
)
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@kitlangton
test(e2e): isolate prompt tests with per-worker backend (anomalyco#20464
468b1a9
)
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@kitlangton
test(e2e): isolate prompt tests with per-worker backend (#20464)
9573ee1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adamdotdevin adamdotdevin Awaiting requested review from adamdotdevin

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

beta contributor Vouched

Projects

None yet

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.

2 participants

@kitlangton @chenyy9527
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.
You are visitor 01402775 — 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.