News for hackers. Stuff that matters.
Re:Setting up pre-commit tests with Git by hamdal on Sunday December 08, 2013 @09:46AM (#6869795)
I'm not sure if this is a good practice. As project grows, running tests takes more time - remember that tests are not only unit tests which should run quickly, there are acceptance tests which can take some time to run. Waiting for commit to finish can become painfully slow.

Additionally, I like to commit partial solutions to feature branch as I work. Later I will fix the mess with rebase - this workflow wouldn't work.

You need CI anyway, so I'd leave tests there, and let the developer decide when to run the unit tests on his machine.

Re:Setting up pre-commit tests with Git by dduvnjak on Sunday December 08, 2013 @09:49AM (#6869804)
This example runs unit tests only, so it doesn't take too long (integration and other tests would still have to be executed on CI). It's more of a convenience than a practice, so you basically don't have to think about running unit tests.
Re:Setting up pre-commit tests with Git by hamdal on Sunday December 08, 2013 @10:00AM (#6869840)
Sure, if you find it convenient - go for it. However, I'd not enforce it as a policy for whole organisation for the reasons outlined above.