Repository navigation
feat(cli): --output json and --output junit to stdout - #1064
Merged
Merged
Conversation
--output accepted only tap, so every other machine-readable format was file-only and any pipeline that wanted to post-process a run had to go through a temp file. The formats and their writers already existed; only the destination was hard-coded. --output now takes text (the default), tap, json or junit. The JSON and JUnit writers are split into a print_* half that renders on stdout and a generate_* half that redirects it into a file, so both sinks emit the same document and --output json --report-json f.json produces both. For every format but text the console rendering is suppressed: header, progress, summary, per-file headers, hook lines, the coverage table, the slowest-tests table and the GitHub Actions annotations, which would all sit inside the document. The parallel spinner and the "\r \r" that erases it are suppressed too -- those bytes landed in front of the XML declaration. --coverage-min still gates (the diff pass runs with its table discarded) and reports its verdict on stderr. Exit codes are unaffected: the machine branch of render_result walks the same failed / flaky / no-tests-found ladder as the console renderer. Closes #1018
11 tasks
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.
🤔 Background
Related #1018
--outputaccepted onlytap, so every other machine-readable format was file-only and a pipeline that wanted to post-process a run had to route it through a temp file. The formats and their writers already existed; only the destination was hard-coded.💡 Changes
--output <text|tap|json|junit>: JSON and JUnit now render on stdout, and--output json --report-json f.jsonstill produces both sinks.--coverage-minverdict, whose diff pass still runs), and exit codes follow the same ladder as the console renderer.tap.