fix(playwright): fix JSON parser and binary resolution#215
Merged
pszymkowiak merged 1 commit intortk-ai:masterfrom Feb 20, 2026
Merged
fix(playwright): fix JSON parser and binary resolution#215pszymkowiak merged 1 commit intortk-ai:masterfrom
pszymkowiak merged 1 commit intortk-ai:masterfrom
Conversation
Three bugs fixed: 1. JSON struct mismatch: The parser expected `suites[].tests[]` but Playwright's JSON reporter outputs `suites[].specs[].tests[]`. Added PlaywrightSpec layer, use `spec.ok` for failure detection, and `errors: Vec<PlaywrightError>` (array, not Option). 2. Float duration: Playwright emits `duration` as f64, not u64. Changed struct field type to avoid deserialization failures. 3. pyenv shim collision: `which playwright` can resolve to a pyenv shim (Python's playwright) which lacks a `test` subcommand. Bypass `which` entirely and resolve through the detected package manager (npx/pnpm/yarn). Also strips user-supplied `--reporter` flags to avoid conflicts with the forced `--reporter=json`.
Collaborator
|
LGTM — tested locally on the branch, all good.
|
heAdz0r
added a commit
to heAdz0r/rtk
that referenced
this pull request
Feb 28, 2026
Upstream 0.22.2 sync (all previously missing fixes verified applied): - fix(lint): propagate linter exit code (rtk-ai#207) — CI false-green fix - feat: add rtk wc command for compact word/line/byte counts (rtk-ai#175) - fix(playwright): JSON parser (specs layer) + binary resolution (rtk-ai#215) - fix(grep): propagate rg exit codes 1/2 (rtk-ai#227) - fix(git): branch creation not swallowed by list mode (rtk-ai#194) - fix(git): support multiple -m flags in git commit (rtk-ai#202) - fix(grep): BRE \| translation + strip -r flag (rtk-ai#206) - fix(gh): smart markdown body filter for issue/pr view (rtk-ai#214) - fix(gh): gh run view --log-failed flag passthrough (rtk-ai#159) - feat(docker): docker compose support (rtk-ai#110) - feat: hook audit mode (rtk-ai#151) - feat: tee raw output to file (rtk-ai#134) Version bump: 0.21.1-fork.19 → 0.22.2-fork.1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes three bugs that cause
rtk playwright testto fall through to passthrough mode (Tier 3) instead of parsing JSON output (Tier 1):1. JSON struct mismatch
The parser expected
suites[].tests[]but Playwright's JSON reporter outputssuites[].specs[].tests[].results[]. Added the missingPlaywrightSpecintermediate struct, usespec.okfor failure detection, and changederrorfromOption<String>toerrors: Vec<PlaywrightError>to match the array format Playwright emits.2. Float duration
Playwright emits
stats.durationas a float (e.g.3519.7039999999997). The struct hadu64, causing deserialization to fail. Changed tof64.3. pyenv shim collision
which playwrightcan resolve to a pyenv shim (Python's playwright package), which doesn't have atestsubcommand. This causes the spawned process to error out before producing any JSON. Fixed by always resolving through the detected package manager (npx/pnpm exec/yarn exec) instead ofwhich.Also strips any user-supplied
--reporterflags so they don't conflict with the forced--reporter=json.Tested against real Playwright test suites — parser now reliably hits Tier 1 (full JSON parse).