Repository navigation
Conversation
98deb2c to
7a1a717
Compare
fix(playwright): consume the value of a space-separated --reporter flag (adopt upstream rtk-ai#3572)
'rtk playwright test --reporter list' stripped only the --reporter token, leaving 'list' behind as a positional argument. Playwright treats it as a test filter, so the run silently executes the wrong (usually empty) test set: 0 tests run, exit 1, 'No tests found'. Strip both --reporter=<name> and '--reporter <name>' (flag + value) before injecting the forced --reporter=json.
7a1a717 to
bd6246f
Compare
|
Rebased on current develop, no conflicts. I added a test that pins the argv Playwright receives for Heads-up on overlap: #3060 fixes the same leak differently, by leaving an explicit reporter untouched, like vitest and deno already do. I built #3060 on develop and ran it against a real Playwright 1.63 project: |
Summary
rtk playwright testforces--reporter=jsonand strips the user's own reporter flag, but for the space-separated form (--reporter list) it removed only the--reportertoken and keptlist--reporter=<name>and--reporter <name>(the flag and its value) before injecting the forced JSON reporterReproduction
Checked against a real Playwright 1.63 project: on develop
rtk playwright test --reporter listruns--reporter=json list, so 0 tests and exit 1; with this branch it runs both tests and exits 0, as do--reporter=listand no flag.Notes
#3060 fixes the same leak differently, by leaving an explicit reporter untouched (both forms) and returning the native output, which is the approach vitest and deno already take. This PR keeps the forced-JSON summary and only stops the leak. Happy to close it in favour of #3060 if that is the direction the maintainers prefer. I built #3060 on develop and ran it against the same project:
--reporter listprints the native list output,--reporter=dotthe dot output, no flag still gives the compact summary, and exit codes are preserved.Test plan
tests/playwright_reporter_test.rs(stand-innpxrecording argv):--reporter listmust not leavelistbehind as a test filter (on develop the argv is[..., "--reporter=json", "list", ...]), and the equals form is still replacedtest_strip_reporter_*(space form consumes the value, equals form, unrelated args kept, trailing flag without a value)cargo fmt --all -- --check,cargo clippy --all-targets(0 warnings),cargo test --all(all pass)