Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running mix test to compile test directory might need a rethink #2778

Open
bhuntpenn opened this issue Aug 5, 2022 · 2 comments
Open

Running mix test to compile test directory might need a rethink #2778

bhuntpenn opened this issue Aug 5, 2022 · 2 comments

Comments

@bhuntpenn
Copy link

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.

@KronicDeth
Copy link
Owner

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.

@bhuntpenn
Copy link
Author

Thanks Elle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants