New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Junit formatter output #9780
Labels
Comments
koic
added a commit
to koic/rubocop
that referenced
this issue
May 6, 2021
Fixes rubocop#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 ```
8 tasks
bbatsov
pushed a commit
that referenced
this issue
May 7, 2021
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 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
When using junit formatter the output is:
which doesn't include some of the common attributes of junit (as per the documentation) such as:
Describe the solution you'd like
Provide a more informative output including the number of total tests ran and the number of failures in the testsuite element.
Describe alternatives you've considered
alternative 1
alternative2
The text was updated successfully, but these errors were encountered: