I’m finding that the startup time to run mix test
on my Phoenix app is getting quite long (5–10 seconds). This isn’t a problem when running the whole suite, but is annoying when I’m test-driving a module that only contains pure functions, and doesn’t interact with the database etc.
For now, I’ve worked round it by using mix test --no-start
where appropriate, and wrapping setup code in test_helper.exs
with a check that the application is running, but it would be nice to run the tests with --no-start
as the default, and start things as appropriate in setup hooks. I had a go at getting that set up, but couldn’t get the Ecto connection checkout stuff to work reliably (particularly with async enabled).
Has anyone got this kind of thing working, or am I embarking on a wild goose chase?