Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #9780. This PR supports summary report for `JUnitFormatter`. It adds the following attributes to the `<testsuite>` element. - `tests` attribute ... Inspected file count. - `failures` attribute ... Total offense count. This is a JUnit format example: ```xml % rubocop -f junit --display-only-failed lib/rubocop/formatter/junit_formatter.rb <?xml version='1.0'?> <testsuites> <testsuite name='rubocop' tests='1' failures='2'> <testcase classname='lib.rubocop.formatter.junit_formatter' name='Layout/LineLength'> <failure type='Layout/LineLength' message='Layout/LineLength: Line is too long. [110/100]'> /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/formatter/junit_formatter.rb:65:101 </failure> </testcase> <testcase classname='lib.rubocop.formatter.junit_formatter' name='Metrics/AbcSize'> <failure type='Metrics/AbcSize' message='Metrics/AbcSize: Assignment Branch Condition size for file_finished is too high. [<8, 16, 2> 18/17]'> /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/formatter/junit_formatter.rb:29:7 </failure> </testcase> </testsuite> </testsuites> ``` These mean the values of `1 file inspected` and `2 offenses detected` below. ```console % rubocop lib/rubocop/formatter/junit_formatter.rb Inspecting 1 file (snip) 1 file inspected, 2 offenses detected, 2 offenses auto-correctable ```
- Loading branch information
Showing
4 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#9780](https://github.com/rubocop/rubocop/issues/9780): Support summary report for `JUnitFormatter`. ([@koic][]) |
This file contains 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
This file contains 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
This file contains 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