-
-
Notifications
You must be signed in to change notification settings - Fork 764
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
Runs specs while preserving only-failures #2470
Comments
FWIW, this use case is what Anyhow, when you talk about "preserving failures", it's not totally clear to me what you mean. I can see a few different ways to understand what you're asking for:
I'm not sure which of these you are asking for. If it's the 1st one, well, RSpec already does that :). It's what makes If it's the 2nd or 3rd cases: it seems to me that the situations where these are useful are pretty specialized, and I'm not sure there's a one-size-fits all approach to serving those cases. Some folks might want only the failures preserved, or all the current statuses preserved, or they might want a given set of failures "snapshotted" for later use (rather than simply preserving it for a specific spec run). Instead of having an option that supports a narrow, specialized case, I think people can manage this themselves by just making a copy of the status file when they don't want it updated, then copying it back when they want to re-use an old status file. Maybe I'm missing something, though... |
Nope, you've got it right--in particular, behaviour #2 is what I implemented in my snippets, pretty much verbatim copying the file around. I agree it's pretty specific, for when you're playing whack-a-mole with a set of problematic tests that aren't sufficiently isolated, with failures popping back up as you work through them. However specific does not necessarily mean uncommon. I think that you're right, without further evidence of this being wanted, there aren't enough perspectives to drive it towards a one-size-fits-all solution. But I couldn't find evidence of this feature being requested before to plus-one it, so now there's a place for it to accrue momentum and attract discussion if it's going to. Until that happens, closing for now. Thanks for letting me bounce the idea off you! |
Hey!
There might be a way to accomplish this that I'm missing, but I'd like to be able to perform a spec run, capture the results for future
--only-failures
runs, but intermittently run other specs without overriding that failure log.My usecase is operating on a large test suite that takes time to run to collect all the current failures, fixing them individually, and occasionally checking my progress against those failures.
The way I'm doing this today is by hacking an extra flag into my
bin/rspec
:then later:
This lets me run
rspec
to capture current failures,rspec --only-failures --preserve-failures
to check in on how many I have made pass (without dismissing them in case I break them again in the process) andrspec --preserve-failures ./spec/specific_spec.rb
to just see how I'm doing with the failure I'm currently working on.This seems like it would be a nice feature to have supported in core if there isn't a supported way to do this already; I'm willing to work on it but wanted to take the temperature first.
The text was updated successfully, but these errors were encountered: