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
Add error-exit-code to differentiate from failures #2749
Conversation
c6929c6
to
a9c50b9
Compare
I did have a green build: https://travis-ci.org/github/rspec/rspec-core/builds/717497518 |
a9c50b9
to
18f43bc
Compare
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.
Thanks for taking the time to add this, I've suggested some refactoring to how this should work, specifically I don't think config is the right place for introspecting the world (especially with injection, thats a potential confusion I'd like to avoid) like this.
If you could also drop the build changes, or seperate them to another PR that'd be helpful.
18f43bc
to
07598ad
Compare
the build changes are now in #2750 |
Thanks, you can see this PR actually passed without them |
07598ad
to
5beca64
Compare
it can be helpful to know if RSpec fails because of an example or if it errors out because it couldn't load a spec file, or there was an issue in the a before(:suite) hook or etc i've named the setting error-exit-code, and tried to add it to all the relevant places, but i don't know rspec codebase well so there was some guessing. in particular i'm not sure what bisect should do. i have it fall back to the failure-exit-code before defaulting to 1 so there's no changes if people don't opt in to the setting. the specific use of this is our CI automatically retries failures using the persistence file, and assumes if they pass on that retry they were flaky. however, the persistence file isn't written to when there's an error outside of examples, so this could mean falsely passing builds. by checking for a different exit code, and then not running the retry we can avoid this issue.
5beca64
to
0709dcb
Compare
@robotdana I'm going to merge this if you're done with it? |
yeah thank you :) |
Thanks, @robotdana ! |
Add error-exit-code to differentiate from failures
it can be helpful to know if RSpec fails because of an example or if it
errors out because it couldn't load a spec file, or there was an issue
in the a before(:suite) hook or etc
i've named the setting error-exit-code, and tried to add it to all the
relevant places, but i don't know rspec codebase well so there was some
guessing. in particular i'm not sure what bisect should do.
i have it fall back to the failure-exit-code before defaulting to 1 so
there's no changes if people don't opt in to the setting.
the specific usecase of this is our CI automatically retries failures using
the persistence file, and assumes if they pass on that retry they were
flaky. however, the persistence file isn't written to when there's an
error outside of examples, so this could mean falsely passing builds.
by checking for a different exit code, and then not running the retry we
can avoid this issue.
This PR also includes me trying to make travis builds work. there were gem/ruby version issues with simplecov-html, childprocecss, & rake (these issues were also present in other RSpec projects, so when it tries to build e.g. rspec-expectations it still fails. that's when i gave up trying to make travis work)