-
-
Notifications
You must be signed in to change notification settings - Fork 753
Include error count for errors occurring outside examples in summary #2351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the x errors occurred
output is confusing. Some test runners (such as minitest and test-unit) differentiate between "failures" (generally an assertion/expectation failure) and "errors" (any other kind of error raised in a test). We've never differentiated that in our output like those runners do, but we do use failure vs error terminology with aggregate_failures
:
I think there are two ways we can go with this:
- Come up with some more specific, accurate language (such as
x errors occurred while loading the suite
) - Keep the more generic "errors" language but do things like the other test runners and include any non-expectation failure in that count
If we go with the first option I think we should also not include this in the output if we have no errors to report. After all, getting errors at spec file load time is a rarity, and most of the time reporting 0 errors occurred
is just noise.
Thoughts?
@@ -281,8 +281,10 @@ def fully_formatted | |||
# @attr pending_examples [Array<RSpec::Core::Example>] the pending examples | |||
# @attr load_time [Float] the number of seconds taken to boot RSpec | |||
# and load the spec files | |||
# @attr errors [Integer] the number of errors that have occurred processing | |||
# the spec suite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name errors
is a bit mis-leading -- usually I'd expect a field called errors
to be an array of errors but here it's just a count. And it's not a count of all errors -- it's a count only of some errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc still says errors
...
It does that, it hooks into the reporter with a method named after exactly that, these are just the only non expectation failure we currently have? |
No, the reporter method name is The failures vs errors distinction I was talking about has to do with the type of exception -- e.g. |
We count an error during an example as a failure, I'm happy to change the wording to |
That is better. |
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple more comments...
@@ -281,8 +281,10 @@ def fully_formatted | |||
# @attr pending_examples [Array<RSpec::Core::Example>] the pending examples | |||
# @attr load_time [Float] the number of seconds taken to boot RSpec | |||
# and load the spec files | |||
# @attr errors [Integer] the number of errors that have occurred processing | |||
# the spec suite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc still says errors
...
@@ -18,6 +18,7 @@ def initialize(configuration) | |||
@failed_examples = [] | |||
@pending_examples = [] | |||
@duration = @start = @load_time = nil | |||
@errors = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about calling this non_example_exception_count
?
c028968
to
c03c0f2
Compare
Updated again |
Merge away. |
[skip ci]
Include error count for errors occurring outside examples in summary
Improve our handling of errors which occur in suite hooks by displaying a count of errors occurred in the summary.
As suggested in #2329
/cc @myronmarston