-
Notifications
You must be signed in to change notification settings - Fork 145
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
(PDK-381) Ensure spec fixtures are cleaned up, even if the test fails #204
Conversation
CLA signed by all contributors. |
I've noticed this and relied on this behaviour. It bit me a few times, for example when I was developing in the airport on slow wifi and accidentally ran (out of custom) Is it possible to revert this or make it configurable? |
The previous behaviour can be achieved by running |
@DavidS you're right that I can achieve it, but as a user I was surprised that in a patch release this changed. |
Also I realise this is a bit of https://xkcd.com/1172/ |
Thanks for your understanding, and apologies for breaking your workflow. |
Another side-effect is that when you use parallel_spec and cancel tests (ctrl+c) that it starts cleaning up fixtures while some tests are still running. This leads to unexpected failures like:
You don't see these when you let the tests continue to run. This is a system with 8 CPUs. |
@ekohl that sounds like an issue with the parallel_tests library rather than our usage. |
@DavidS possibly, but in the end I'm using the spec helper and this is the experience it provides me. |
Thanks, that does explain it. |
Currently if the rspec tests fail, the
spec_clean
task is not invoked as rake aborts. By moving thespec_clean
task into anensure
block, it will get run and clean things up even when the rspec tests fail.