5 ms·
I use autotest for this - it notices files being altered and runs relevant parts of your suite. If something goes wrong it'll keep trying that test everytime yo
by elliottkember 16y ago
I use autotest for this - it notices files being altered and runs relevant parts of your suite. If something goes wrong it'll keep trying that test everytime you save a file, until it works. I think it's fantastic.
- icefox 16y agoDo you have a link to autotest? I run something similar. My ruby projects are all in git. I have a git pre-commit hook that when file X is modified before allowing a commit will run the test for X and only allow me to commit if the tests for X passes. This happens with zero work on my part forcing me to never forget to run the tests. While it doesn't run all of the tests just running the associated test catches a very larger number of accidental test failures for very little cost. Lastly because the tests are being run all of the time if one suddenly takes a long time to run I quickly profile it and speed it up. And --no-verify is always there to bypass the hook if need be.
- Kaya 16y agoHow do you handle the case where file X uses file Y, and you commit file Y? You could run the test for X when Y is committed in case Y broke X.
- icefox 16y agoFor most of my projects I don't. Some of them have some rules listing test x depends upon y, but for the vast majority of my projects modify file X and only test X is run. This catches a huge non-insignificant amount of regressions. Really it comes down to effort. I can either A) try to remember to always run tests before committing or B) Have a basic hook that takes minutes to write/install that will always run at least one test and catch near all regressions. I tried to do A for years. Most of the time you run the tests, but not always. And heaven help you if you are on a team. There will be someone who never runs tests. And you will end up having to schedule a chunk of time for regression fixing before every release. So to answer you question who cares about when file X uses file Y.
- steveklabnik 16y agohttp://rubygems.org/gems/autotest http://rubygems.org/gems/autotest