test: add subprocess e2e suite driving plugins as Flow Launcher does#29
Open
Garulf wants to merge 1 commit into
Open
test: add subprocess e2e suite driving plugins as Flow Launcher does#29Garulf wants to merge 1 commit into
Garulf wants to merge 1 commit into
Conversation
Spawn fixture plugins across a real process boundary using the exact mechanics of the host: V1 gets one JSON-RPC request in argv[1] in a fresh process per query; V2 is a persistent process speaking newline-delimited JSON-RPC over stdin/stdout. Covers query/context_menu roundtrips, settings delivery, unicode, lifecycle (initialize/close), $/cancelRequest notifications, malformed input resilience, stdout stream purity, and process persistence - buffering/encoding/stream-pollution bugs that in-process tests with patched stdio cannot catch. Also adds a windows-latest CI job running the e2e tests, since Flow Launcher plugins only ever run on Windows.
Garulf
force-pushed
the
test/e2e-subprocess
branch
from
July 13, 2026 12:52
4068569 to
ca29f56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
tests/e2e/: end-to-end tests that spawn fixture plugins as real subprocesses using the exact process mechanics Flow Launcher uses, asserting on the raw stdout stream.argv[1], response deserialized from stdout — mirroringJsonRPCPluginin the host.params: [{search: ...}, Settings.Inner], lifecycle methods,$/notifications).Two self-contained fixture plugins (
tests/e2e/fixtures/{v1,v2}_plugin/) with realplugin.jsonmanifests, so launcher auto-detection (Language: pythonvspython_v2) is exercised end-to-end too.What this catches that in-process tests can't
The existing integration tests patch
sys.stdin/stdoutin-process — great protocol coverage, but blind to:print, warnings) corrupting the JSON streamclose, surviving malformed input, one process serving many queriesCoverage
14 tests: query/context_menu roundtrips, settings delivery (both protocols), unicode, empty query,
initialize/close,$/cancelRequestignored silently, malformed line resilience, stdout purity, process persistence. Subprocesses run withcwd=tmp_pathsoplugin.lognever lands in the repo, and a reader thread with timeouts ensures a hung plugin fails fast instead of hanging CI.CI
pytest testspicks uptests/e2e/).e2e-windowsjob onwindows-latest(tox -e py311 -- tests/e2e), since Flow Launcher plugins only ever run on Windows.Verification
tox -e lint,type,py38,py312all green — 148 tests (134 existing + 14 new).