fix(playwright): fix JSON parser to match real Playwright output format#193
Merged
pszymkowiak merged 1 commit intortk-ai:masterfrom Mar 4, 2026
Merged
Conversation
Collaborator
|
Thanks for this! Could you rebase on master? The branch is 2 commits behind. We'll review once it's up to date. |
Three bugs caused `rtk playwright test` to always fail with EXIT: 1: 1. **Wrong argument order**: `--reporter=json` was inserted before the subcommand (e.g. `playwright --reporter=json test`), but Playwright requires flags after the subcommand (`playwright test --reporter=json`). 2. **Float duration deserialization**: `PlaywrightStats.duration` was typed as `u64`, but real Playwright output emits a float (e.g. `3519.703...`), causing serde_json to fail with a type error. 3. **Wrong suite structure**: Suites contain `specs` (not `tests`). Each spec has `ok: bool` and `tests` (per-browser executions). The old struct used `tests: Vec<PlaywrightTest>` directly in suites, which never matched real output and always failed JSON parsing. Fixes: - Move `--reporter=json` to after the first arg (the subcommand) - Change `duration: u64` to `duration: f64` in `PlaywrightStats` - Rewrite `PlaywrightSuite` → `specs: Vec<PlaywrightSpec>` - Add `PlaywrightSpec` with `ok: bool` and `tests: Vec<PlaywrightExecution>` - Add `PlaywrightExecution` with `status` and `results: Vec<PlaywrightAttempt>` - Update `PlaywrightAttempt` to use `errors: Vec<PlaywrightError>` (array) - Add tests covering float duration, real suite structure, and failure details Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c963263 to
8f03e7e
Compare
heAdz0r
added a commit
to heAdz0r/rtk
that referenced
this pull request
Feb 28, 2026
…tk-ai#217, rtk-ai#196, rtk-ai#248, rtk-ai#211, rtk-ai#200, rtk-ai#192, rtk-ai#268) Wave 1 (critical bugs): - fix(registry): fi/done moved to IGNORED_EXACT — find no longer shadowed (rtk-ai#246) - fix(playwright): f64 duration, specs[] structure, --reporter=json after subcmd (rtk-ai#193) - fix(gh): should_passthrough_gh_view for --json/--jq/--template/--web in view_pr/issue/run (rtk-ai#217+196) Wave 2 (reliability): - fix(git): is_blob_show_arg — blob show passthrough without trailing-newline trim (rtk-ai#248) - fix(find): parse_find_args with native -name/-type/-maxdepth/-iname support (rtk-ai#211) - fix(main): graceful Clap fallback + parse_failures SQLite table + rtk gain --failures (rtk-ai#200) Wave 3 (UX): - feat(git): global options -C/-c/--git-dir/--work-tree/--no-pager/--no-optional-locks/--bare/--literal-pathspecs (rtk-ai#192) - feat(proxy): streaming output via spawn()+threads instead of buffered output() (rtk-ai#268) Tests: 1091 → 1117 (+26), 0 regressions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Hi, this PR has conflicts with master in |
Collaborator
|
Reviewed and tested locally — 414 tests pass (5 playwright-specific), 0 clippy warnings. Clean merge with master. All 3 bugs are real issues that made
LGTM — ready to merge. |
maxkulish
added a commit
to maxkulish/rtk
that referenced
this pull request
Mar 18, 2026
Implements 6 bug fixes from upstream rtk-ai/rtk (v0.29.0): P1.3a - playwright: JSON parser already matches real output format (rtk-ai#193) - Already uses proper suites → specs → tests → results structure - Handles float duration correctly (f64 type) - No changes needed P1.3b - cargo: `--` separator already preserved (rtk-ai#326) - Already uses trailing_var_arg + allow_hyphen_values - rtk cargo test -- --nocapture works correctly - No changes needed P1.3c - lint: strip npx/bunx/pnpm prefixes for linter detection (rtk-ai#186/rtk-ai#366) - Add strip_pm_prefix() to remove package manager prefixes - Add detect_linter() for accurate linter identification - Fixes: npx eslint, bunx biome, pnpm exec eslint - Tests: test_strip_pm_prefix(), test_detect_linter() P1.3d - grep: BRE alternation translation already implemented (rtk-ai#206) - Already translates \| (BRE) → | (PCRE) for rg - Already strips -r flag (rg recursive by default) - Comprehensive tests already exist - No changes needed P1.3e - filter: add Language::Data to prevent JSON/YAML/TOML corruption (rtk-ai#464/rtk-ai#479) - Add Language::Data variant for data files - Map 20 data file extensions (json, yaml, toml, xml, md, csv, etc.) - Data language has NO comment patterns (all None) - Fixes: packages/* in package.json no longer stripped as /* comment - Tests: test_data_language_no_comment_stripping() P1.3f - npm: fix routing to distinguish subcommands from scripts (rtk-ai#470) - Add NPM_SUBCOMMANDS constant (59 known npm commands) - Proper routing: npm install → npm install (not npm run install) - Proper routing: npm build → npm run build (script) - Tests: test_npm_subcommand_routing() validates all 59 subcommands Files modified: - src/lint_cmd.rs: Add PM prefix stripping - src/filter.rs: Add Language::Data variant - src/local_llm.rs: Add Language::Data match arm - src/npm_cmd.rs: Add NPM_SUBCOMMANDS routing Quality checks: ✅ cargo fmt --all ✅ cargo clippy --all-targets (0 errors) ✅ cargo test (514 passed; 0 failed) Improves RTK reliability across JS/TS, data files, and npm workflows.
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.
Three bugs caused
rtk playwright testto always fail with EXIT: 1:Wrong argument order:
--reporter=jsonwas inserted before the subcommand (e.g.playwright --reporter=json test), but Playwright requires flags after the subcommand (playwright test --reporter=json).Float duration deserialization:
PlaywrightStats.durationwas typed asu64, but real Playwright output emits a float (e.g.3519.703...), causing serde_json to fail with a type error.Wrong suite structure: Suites contain
specs(nottests). Each spec hasok: boolandtests(per-browser executions). The old struct usedtests: Vec<PlaywrightTest>directly in suites, which never matched real output and always failed JSON parsing.Fixes:
--reporter=jsonto after the first arg (the subcommand)duration: u64toduration: f64inPlaywrightStatsPlaywrightSuite→specs: Vec<PlaywrightSpec>PlaywrightSpecwithok: boolandtests: Vec<PlaywrightExecution>PlaywrightExecutionwithstatusandresults: Vec<PlaywrightAttempt>PlaywrightAttemptto useerrors: Vec<PlaywrightError>(array)