KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.83k stars 153 forks source link

"Unknown error" when attempting to run mix test #1224

Closed gmile closed 6 years ago

gmile commented 6 years ago

I'm getting the following error message when attempting to run a line from a test file:

6:02 PM Error running 'Mix ExUnit contractbook_domain test/contractbook_domain/alert/loader_test.exs:27': Unknown error

image

I'm using:

This is my project's SDK setup: image

This is my Run definition: image

This is the first time I'm trying intellij-elixir. I'm getting the same problem on a new and existing Mix projects.

Am I missing something obvious? How do I debug this?

KronicDeth commented 6 years ago
  1. Where did you put the breakpoint?
  2. What is on test_project_test.exs line 6 that has the error?

I likely cannot debug "Unknown error" without running a build of the plugin under the debugger and then running the same steps you're using. Would you be willing to share a repo with the code, so I can reproduce the problem?

KronicDeth commented 6 years ago

Other thing to check: you showed that you have the SDK setup in SDKs, but not that you assigned it to your project. Does Project Settings > Project show you selected that SDK as the project SDK? This would happen automatically if you used Mix project import steps in the README.

gmile commented 6 years ago

Where did you put the breakpoint?

This is vanilla mix project. I ran mix new test_project, opened the folder in IntelliJ Idea, found the test file, put the cursor on a line with a single test.

image

Would you be willing to share a repo with the code, so I can reproduce the problem?

I can do that, but as I said, this is vanilla project. After running mix new test_project, I didn't change any single file.

Other thing to check: you showed that you have the SDK setup in SDKs, but not that you assigned it to your project.

Here it is:

image

KronicDeth commented 6 years ago

I'm using the same homebrew setup as you, just with Erlang 21.0.4 and Elixir 1.7.2 and it worked fine for me, so it could be something weird specifically with Elixir 1.7.0 or Erlang 21.0.5.

I didn't know they released Erlang 21.0.5.

I can upgrade to Erlang 21.0.5 to check that, but I don't have Elixir 1.7.0 installed, only 1.7.1 and 1.7.2. I'll check 21.0.5 locally.

KronicDeth commented 6 years ago

No, it still works for me with 21.0.5.

KronicDeth commented 6 years ago
  1. brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/40eff835b162dce0c0bd95eb800ce68e351f59d0/Formula/elixir.rb
  2. Switch SDK to Elixir 1.7.0

I still can't reproduce the problem. It works for me:

/usr/local/Cellar/erlang/21.0.5/lib/erlang/bin/erl -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib -pa /usr/local/Cellar/elixir/1.7.2/lib/logger/ebin -pa /usr/local/Cellar/elixir/1.7.2/lib/elixir/ebin -pa /usr/local/Cellar/elixir/1.7.2/lib/ex_unit/ebin -pa /usr/local/Cellar/elixir/1.7.2/lib/mix/ebin -pa /usr/local/Cellar/elixir/1.7.2/lib/eex/ebin -pa /usr/local/Cellar/elixir/1.7.2/lib/iex/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/wx-1.8.4/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/otp_mibs-1.2/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/inets-7.0/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/kernel-6.0/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/parsetools-2.1.7/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/tftp-1.0/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/sasl-3.2/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/crypto-4.3.1/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/hipe-3.18/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/diameter-2.1.5/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/eldap-1.2.4/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/tools-3.0/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/reltool-0.7.6/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/eunit-2.3.6/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/erl_docgen-0.8/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/erl_interface-3.10.3/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/runtime_tools-1.13/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/public_key-1.6.1/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/xmerl-1.3.17/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/observer-2.8/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/ftp-1.0/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/compiler-7.2.3/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/edoc-0.9.3/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/stdlib-3.5.1/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/mnesia-4.15.4/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/dialyzer-3.3/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/syntax_tools-2.1.5/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/ssl-9.0/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/et-1.6.2/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/snmp-5.2.11/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/os_mon-2.4.5/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/ssh-4.7/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/megaco-3.18.3/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/debugger-4.2.5/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/common_test-1.16/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/erts-10.0.5/ebin -pa /usr/local/Cellar/erlang/21.0.5/lib/erlang/lib/asn1-5.0.6/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra -r /private/var/folders/kz/_y_vgl6505v0hgx16pt1vdsr0000gn/T/intellij_elixir3963/exunit/1.6.0/team_city_ex_unit_formatting.ex -r /private/var/folders/kz/_y_vgl6505v0hgx16pt1vdsr0000gn/T/intellij_elixir3963/exunit/1.6.0/team_city_ex_unit_formatter.ex /usr/local/Cellar/elixir/1.7.2/bin/mix test --formatter TeamCityExUnitFormatter test/test_project_test.exs:6

So, it seems that it's something specific to your environment that we haven't been able to capture in the screenshots.

You can either setup the development environment yourself and use the debugger yourself, or we can setup a time to do screenshare either tomorrow or sometimes this week.

gmile commented 6 years ago

@KronicDeth as weird as it can be, the issue has self-fixed itself. I have no idea how it happened, but I no longer get the error mentioned previously.

So, what changed between "not working" and "working" states?

Projects above was opened in IntelliJ using pure "Open..." instead of "Open project from existing sources..." (as you recommend). After opening the project, I had to manually tell IntelliJ idea that the project is Mix project (e.g. setup the SDK). I suppose I was doing something wrong when configuring Elixir SDK for project manually.

As soon as I tried importing project, and went through this:

image

Everything works now, even for new projects opened via pure "Open..." – they are automatically identified as Mix projects, the tests are working, everything is fine now.

Sorry for the trouble. I'm closing the issue, as I don't want it hang around while everything is working for me now.

I wish to debug this further though. Do you now how to reliably wipe out IntelliJ out of the system, including dotfiles and dotfolders, if any? I could try this again from scratch and record a screencast for you.