-
-
Notifications
You must be signed in to change notification settings - Fork 753
Conversation
@@ -98,7 +98,7 @@ | |||
end | |||
|
|||
Given /^I have a brand new project with no files$/ do | |||
in_current_dir do | |||
in_current_directory do |
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.
Are these intentional changes? Or have you just not rebased recently...
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.
I think these are why the build is failing BTW, we've upgraded some Aruba things lately
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.
This changes are part of the first commit. I have no idea why, but I had failures locally that could be only silenced by renaming these methods. The build is failing only because of these methods that have been renamed. Give me a second, I'll delete the commit and push the branch up again.
@JonRowe, I managed to get rid of Rubocop's warning by extracting the logic into its own module. The remaining failures do not appear to be related to my changes (?). Are you familiar with them? I am going to squash/reword commits and start to look into the parser after having understood these errors. |
The last remaining build failures are due to documentation coverage dropping below 100% |
@@ -0,0 +1,17 @@ | |||
module RSpec | |||
module Core | |||
module FailFastHandler |
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.
There's no docs for this module which is what is putting off the coverage, mark the methods and module with # @api private
if they're not intended for public usage.
@jackscotti can you share the full yarddoc output for undocumented classes? |
@samphippen, sorry I have been away from any electronic device for the last 2 weeks. Friday I will restart to work on this (and provide you the yarddoc). |
@jackscotti no problem, 👍 |
You fixed the missing documentation coverage but the build is failing due to missing test coverage. As of #1905 we enforce that rspec-core has 100% test coverage on ruby 2.1 and above. This has helped identify dead code and some bugs. To see this locally, you'll need to run |
@@ -26,7 +26,7 @@ module Core | |||
# your examples defined in {MemoizedHelpers} and {Pending}. | |||
class ExampleGroup | |||
extend Hooks | |||
|
|||
extend FailFastHandler |
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.
Since FailFastHandler
is completely private and doesn't have any APIs we want to expose to users, there's no need for the methods to be added to ExampleGroup
like this. After all, it's not a property of the example group class whether or not the failures number has been met. I'd prefer it if you just made the methods exposed by FailFastHandler
module methods and called them as e.g. FailFastHandler.failures_number_met?
w/o extending the module.
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.
Actually, seeing failures_number_met?(reporter.failed_examples.count)
below makes me think that these method defs should perhaps move to the reporter: then it can just be reporter.fail_fast_limit_met?
. After all, the reporter holds the state of reporter.failed_examples.count
already and it has a reference to the configuration instance. We try to limit how much we access our global state (e.g. RSpec.configuration
and RSpec.world
) so it's nice to use instances that objects have already been passed such as reporter already having a config instance.
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 way of implementing it you're suggesting sounds better, I will address it as soon as I can. Thank you for the great feedback and apologise for the noise, I am pretty unfamiliar with this codebase.
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.
No apology needed. Thanks for contributing! RSpec is better because of contributions like yours.
Alright, seems like we managed to get Simplecov happy. Thank you again for all the feedback, I will address it next time I'll work again on this. :) |
RSpec.world.wants_to_quit = true if fail_fast? && !succeeded | ||
if !succeeded && fail_fast? | ||
RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met? | ||
end |
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.
I'd still like to see the two if
statements here combined into one. Nesting them seems messier and unnecessary to me.
@myronmarston , I have one error I do not understand and one of code not covered. That line of code hasn't been introduced by me, why do you think Simplecov is picking it up only now? And, are you familiar with the error? Update: |
Yeah, the Ruby 2.2.0 warning is extremely annoying, particularly because of RSpec's |
WOOOOHOOOO!! All green! To note that if I address @JonRowe comment about removing This PR is now ready for review, I will squash/rename/reword the commits ASAP. |
|
||
```ruby | ||
RSpec.configure { |c| c.fail_fast = true } | ||
``` |
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.
This is documentation and should be restored (although you can add a comment that true means 1)
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.
Do we still have an example of just a bare --fail-fast
?
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.
Because you didn't follow the second part and rename the let instead ;)
Just a few final tweaks, and yep if you could squash the commits that'd be great :) |
Is there anything I can do to get this PR merged? |
@jackscotti when was the last time you rebased against master? I definitely saw something about aruba flying by in my inbox, so that might solve the problem. |
I'd still like to solve the issue with the CLI, tests pass for me and it works but cucumber doesn't seem to like it |
Thanks for getting back to me so quickly! Rebased on master, now the error is changed. Don't really undertand what is complaining about? It seems to be related to Aruba and not to the code I've introduced. |
The failure isn't related to aruba other than the fact that it's a cucumber scenario and we use aruba in our cucumber scenarios and "aruba" is in the directory name that gets used for the scenario. The failing scenario is the |
Yes, you are right. We are back to the original error then. What should the parser accept? |
I have no idea how to get it to work without the |
BTW, before merging it would also be nice to not have 19 commits (including some merge commits). Do you mind rebasing and squashing those out so that the PR has a small number of logical commits? If that's difficult for you (it's one of those git things that's tricky to do for the first time) let me know and I can push up what you've got to a branch so we can get it merged from there. Also, sorry for the long delay on this. We've done a poor job at helping you get this ready :(. |
Really no need to be sorry, I know you've all got a lot to do!! I am going to rebase/squash/reword the commits and let you know when I think I am done, so you can tell me whether the final result is good or not. Thank you for the great feedback and patience. |
A configurable fail-fast requires OptionParser to be able to handle Integer parameters and filter out anything non-Integer.
The reporter is already ware of the number of failed examples but it should also know whether the required number of failures has been met. Reporter#fail_fast_limit_met? will be used by ExampleGroup to check whether it should stop running examples.
Set `RSpec.world.wants_to_quit = true` when the required number of failed examples has been met.
Make --fail-fast configurable
- Better warning when an invalid value is passed for `--fail-fast` (including silencing call site since it will not be in user code). - No need to stub `reporter.failures_required`. - No need for the `failures_required` method at all. - Use `fail_fast_limit_met?` in more situations. - Remove unneeded `ExampleGroup.fail_fast?` method.
Thanks, @jackscotti! |
- Better warning when an invalid value is passed for `--fail-fast` (including silencing call site since it will not be in user code). - No need to stub `reporter.failures_required`. - No need for the `failures_required` method at all. - Use `fail_fast_limit_met?` in more situations. - Remove unneeded `ExampleGroup.fail_fast?` method.
Make --fail-fast configurable
- Better warning when an invalid value is passed for `--fail-fast` (including silencing call site since it will not be in user code). - No need to stub `reporter.failures_required`. - No need for the `failures_required` method at all. - Use `fail_fast_limit_met?` in more situations. - Remove unneeded `ExampleGroup.fail_fast?` method.
Followups from rspec#2065.
The aim of this PR is making
fail-fast
configurable, requested here: #1874