Repository navigation
fix(vitest): read the JSON report from a file so vitest 5 is parsed - #4264
Open
mrhard9090 wants to merge 1 commit into
Open
mrhard9090 wants to merge 1 commit into
mrhard9090 wants to merge 1 commit into
Conversation
Vitest 5 writes the JSON report to .vitest/json/output.json and prints only its path. Send it to a temp file with --outputFile.json and parse that, falling back to stdout when no file was written. Fixes rtk-ai#4224
📊 Automated PR Analysis
SummaryFixes vitest 5 JSON report parsing by writing the report to a temp file via Review Checklist
Linked issues: #4224 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
syedmuhdahmad
added a commit
to syedmuhdahmad/qa-agent-kit
that referenced
this pull request
Oct 2, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 2, 2026
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
Fixes #4224
.vitest/json/output.jsonand prints onlyJSON report written to <path>.rtk vitest runparsed stdout, so every parser tier failed. It passed that one line through, left the report file in the project, and recorded the run as nearly all saved.--outputFile.json=<temp file>next to--reporter=jsonand parses the report from that file. The temp file is removed when the run ends. Vitest 4 honours the same option, so both versions take the same path. If the file is missing or empty, rtk parses stdout as before.emit_guardedcompares the summary against it, the recovery tee stores it and tracking counts savings from it. Without this, the guard compared a failure summary with the one-line stdout and printed that line instead.--outputFileor--outputFile.json, the report path is left alone (detected witharg_tokenizer, before any--).Test plan
test_vitest_effective_args_send_json_report_to_file,test_vitest_effective_args_keep_explicit_output_fileandtest_vitest_reads_report_file_instead_of_stdout.rtk vitest runprintsPASS (1) FAIL (1)with the failing test and its assertion error, and exits 1. With both tests passing on 5.0.2 it printsPASS (2) FAIL (0)and exits 0. No.vitestdirectory and no temp report is left behind.cargo fmt --all && cargo clippy --all-targets(clean)&& cargo teston Windows (MSVC): 3744 passed, 2 failed.find_cmd::run_from_args_propagates_find_exit_statusandstream::test_read_lines_lossy_preserves_lines_after_invalid_utf8fail the same way ondevelopon this machine.Written with help from Claude Opus 5.5.