We run a Grails application with Spring Security. Our integration tests are slow: 5m34s for 414 tests including about 45secs app boot time. That’s about 1,4 test per second. Not that great. These tests are mainly functional tests, using GEB. I suspected the overhead of the browser automation would be the culprit, but when it comes to performance, measure, don’t guess.
I started writing well scoped tests: one that does nothing, one that hit a dummy controller that returns ok, one that creates a Company and cleans it afterwards, one that creates a Company and an Employee - a pattern we use extensively in our tests. (…)