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

burnettk commented May 28, 2020

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

This comment has been minimized.

Copy link
@bbatsov

bbatsov May 31, 2020

Collaborator

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

This comment has been minimized.

Copy link
@bbatsov

bbatsov May 31, 2020

Collaborator

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

burnettk commented May 31, 2020

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

@burnettk burnettk force-pushed the burnettk:add-display-only-failed-option-for-format-junit branch from e839032 to 7600a3c May 31, 2020
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 burnettk:add-display-only-failed-option-for-format-junit branch from 7600a3c to b6f775a May 31, 2020
@@ -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).

This comment has been minimized.

Copy link
@bbatsov

bbatsov Jun 1, 2020

Collaborator

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-hq:master Jun 1, 2020
26 checks passed
26 checks passed
windows 2.4
Details
windows 2.5
Details
windows 2.6
Details
windows 2.7
Details
windows mingw
Details
ci/circleci: cc-setup Your tests passed on CircleCI!
Details
ci/circleci: cc-upload-coverage Your tests passed on CircleCI!
Details
ci/circleci: documentation-checks Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-rubocop Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-spec Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.