intellij-elixir
intellij-elixir copied to clipboard
Running `mix test` to compile `test` directory might need a rethink
In intellij it is possible to configure a directory as sources
(lib
directory), test sources
(test
directory) or whatever.
In fact, when a project is imported, these directories are automatically configured as such (which is correct).
When a directory is marked as sources
(and the option to compile using mix is checked), intellij-elixir compiles the directory using the command mix compile
.
When a directory is marked as test sources
, i.e. the test
directory, intellj-elixir compiles the directory, using the command mix test
.
This would be an admirable option if the test cases ran in anything like a reasonable amount of time, however, on a certain project, and I have neither the means nor wherewithal to fix this, the tests take 12 minutes to run and crash unless run in the CI environment.
I can just remove the configuration which sets the test directory as test sources - and everything works great, however, the out of the box experience isn't great, but for an hours debugging I would have presumed that intellij-elixir build command was broken (it doesn't produce any console output so can only tell what it's doing by running pstree
).
Anyhow, maybe it would be better to just have it run mix compile
on both the lib
and test
folders and let the user run tests using the run configurations.
I don’t personally use the Build Project tool at all, so I don’t really think of this experience. I compile projects when I run mix test or mix phx.server or the iex variant in a Run Configuration.
Having the tests marked as tests also influencing the searching for references and it might influence Go To Test, but I’m not sure if I’m just using the name or directory type for that one.
I’ll have to think about this and check the implications.
Thanks Elle