Not really sure if this is a question or suggestion, but in an attempt to speed up our tests, we switched to .ex files and have them compiled by default using mix. When
Mix.env == :test,
elixirc_paths pretty much looks like:
defp paths(:test) do # need to start this here since compilation of a ExUnit.Case causes the # module to be registered in ExUnit.Server (via an after_compile hook) Application.ensure_all_started(:ex_unit) paths(:prod) ++ ["test"] end
Instead of building the built-in mix test task, we have our own simplified that a) is able to leverage the already-compiled modules and b) maintains some of the basic functionality we needed (like cover, and being able to run specific path/file with optional line number.
Depending on the computer, this shaves 5-20 seconds off running our tests. It can be slower for single runs in specific conditions (like touching a lot of tests, but only running 1), but even this is faster when you eventually run those other touched tests.
What would make this much better is if this was simply a flag that can be passed to
Am I the only one that finds the startup time of
mix test to be prohibitive?