ananthakumaran / exunit.el

Emacs ExUnit test runner
42 stars 15 forks source link

ExUnit can't find the right Elixir install #14

Closed andyleclair closed 2 years ago

andyleclair commented 2 years ago

I've got exunit.el installed in my emacs via DOOM and I'm having this issue every time I try to run the tests (or iex for that matter) in any buffer.

-*- mode: exunit-compilation; default-directory: "~/src/api/" -*-
ExUnit Compilation started at Thu Jun 23 11:16:36

mix test test/api/data/kafka_producer_test.exs
Could not start Hex. Try fetching a new version with "mix local.hex" or uninstalling it with "mix archive.uninstall hex.ez"
** (MatchError) no match of right hand side value: {:error, {:ssl, {'no such file or directory', 'ssl.app'}}}
    (hex 1.0.1) lib/hex.ex:5: Hex.start/0
    (mix 1.13.3) lib/mix/hex.ex:59: Mix.Hex.start/0
    (mix 1.13.3) lib/mix/dep/loader.ex:194: Mix.Dep.Loader.with_scm_and_app/4
    (mix 1.13.3) lib/mix/dep/loader.ex:147: Mix.Dep.Loader.to_dep/3
    (elixir 1.13.3) lib/enum.ex:1593: Enum."-map/2-lists^map/1-0-"/2
    (mix 1.13.3) lib/mix/dep/loader.ex:364: Mix.Dep.Loader.mix_children/2
    (mix 1.13.3) lib/mix/dep/loader.ex:18: Mix.Dep.Loader.children/0
    (mix 1.13.3) lib/mix/dep/converger.ex:57: Mix.Dep.Converger.all/4

ExUnit Compilation exited abnormally with code 1 at Thu Jun 23 11:16:37

This seems to me that exunit.el is not running in the context of the right shell (or maybe is being compiled without my shell env?) However, when I open eshell and run commands like elixir -v, iex -S mix, or mix test everything works just fine. Running (exunit-project-root) from eshell returns the right directory.

I'm sorta new to emacs so please let me know if I'm doing something horribly wrong or if this isn't the right way to go about solving this issue. Thank you for the package!

ananthakumaran commented 2 years ago

try to run M-x compile mix test. if it fails with the same error, then you need to figure out how to fix it. Have a look at exec-path value, it might not be set properly. Also check https://github.com/purcell/exec-path-from-shell