-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Allow running rspec in interactive mode #2796
Comments
Do you use Otherwise, you may take a look at this https://relishapp.com/rspec/rspec-core/v/3-9/docs/running-specs-multiple-times-with-different-runner-options-in-the-same-process Pretty sure this will be a useful extension, but I'm not sure it's a common case. E.g. my current Rails project loads the env in under 2 seconds. |
The problem with pinning your environment, is it won't be reloaded, its not as simple as "load your environment, run specs, await your command to run specs again" we would need to know what files changed, clear our the old code, reload those files, and then run specs again. As @pirj points out this is an approach Rails has tried for many years to speed up its notoriously slow boot time and there are several solutions that have spun out from that, there isn't one solution because its really hard, and at best its a band aid and has numerous problems. That isn't something RSpec is interested in maintaining. However. If you wanted to work on an api defining a "preload" hook, a "reload" hook, and a "trigger", then have an interactive mode that calls preload, runs specs, resets, then calls the reload hook when triggerd, I would not be against that. But I don't want to maintain the magic of reloading code ourselves. |
Subject of the issue
There can be a situation when one small test is failing and you spend hours to make it work. But initialization can take so long, so it is about 30 seconds waiting for initialization and 1 second to execute the test. I wonder, what if rspec supported interactive mode, like waiting for file or files for input and running them interactively? I can prepare a PR for that if is is acceptable.
Your environment
Steps to reproduce
Proposition
-i, --interactive
flag that allows running rspec in interactive mode when it loads the environment once and only runs needed testsThe text was updated successfully, but these errors were encountered: