Skip to content
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

New option --display-only-failed for junit format #8050

Conversation

burnettk
Copy link
Contributor

Speeds up test report processing for large codebases and helps address
the sorts of concerns raised at
mikian/rubocop-junit-formatter#18.

In one case for me, this reduced the number of testcase xml elements from 66,000 to 1, which made a material difference in terms of jenkins test report load times.

Refactors file_finished method in junit_formatter.rb to reduce
complexity.

Fixes buggy error message when --disable-uncorrectable is run without
--auto-correct, which I noticed because I added similar error messaging
when you try to run --display-only-failed without --format junit.

Tests, CHANGELOG.md, and help message updates to accompany new option

.to raise_error(RuboCop::OptionArgumentError)
end

it 'works if given with --format json' do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you meant to write junit here.

@@ -92,6 +92,8 @@ def abs(path)
This option applies to the previously
specified --format, or the default format
if no format is specified.
--display-only-failed Only output offense messages. Omit passing
cops. Only valid for --format junit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot the final .

@bbatsov
Copy link
Collaborator

bbatsov commented May 31, 2020

I'm fine with the proposed change. I think it'd be a good idea to also mention it here https://docs.rubocop.org/rubocop/formatters.html#junit-style-formatter

@burnettk
Copy link
Contributor Author

Corrected the two specific issues and updated the relevant documentation. I love this tool, @bbatsov, thank you!

@burnettk burnettk force-pushed the add-display-only-failed-option-for-format-junit branch from e839032 to 7600a3c Compare May 31, 2020 21:43
Speeds up test report processing for large codebases and helps address
the sorts of concerns raised at
mikian/rubocop-junit-formatter#18.

Refactors file_finished method in junit_formatter.rb to reduce
complexity.

Fixes buggy error message when --disable-uncorrectable is run without
--auto-correct, which I noticed because I added similar error messaging
when you try to run --display-only-failed without --format junit

Tests, CHANGELOG.md, doc updates, and help message updates to accompany
new option.
@burnettk burnettk force-pushed the add-display-only-failed-option-for-format-junit branch from 7600a3c to b6f775a Compare May 31, 2020 21:45
@@ -242,7 +242,7 @@ The JSON structure is like the following example:
**Machine-parsable**

The `junit` style formatter provides the JUnit formatting.
This formatter is based on [rubocop-junit-formatter gem](https://github.com/mikian/rubocop-junit-formatter).
This formatter is based on the [rubocop-junit-formatter gem](https://github.com/mikian/rubocop-junit-formatter).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't make the same edit to the actual docs. There's no need to touch the markdown files - they will be removed as soon as we setup permanent redirects between the old docs site that used them (powered by RTD) and the new one (docs.rubocop.org).

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 1, 2020

Thanks for tackling this! I'll do the small doc change I mentioned myself.

@bbatsov bbatsov merged commit c1e0f10 into rubocop:master Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants