azazel75
Hello,
almost total newbie coming from Python here. I’m developing my first
Phoenix+Ecto application and now I’m in the process of importing
some data from an old database and writing tests for it.
I’m using Elixir 1.9.2/OTP 22 and latest Ecto 3 (3.2.4)
I wanted to debug an issue happening with the test and because I’m
using the nice ElixirLS
(the fork) with my editor (emacs 26) I wanted to try out its debug
support. As
advised, I
have prepared a configuration for the debugging session, here is its
translation in elisp:
(list :type "Elixir"
:cwd "/home/azazel/wip/journey/apps/data/"
:request "launch"
:task "test"
:dap-server-path '("/home/azazel/wip/elixir/elixir-ls/release/debugger.sh")
:taskArgs (list "--trace")
:projectDir "/home/azazel/wip/journey/apps/data/"
:requireFiles (list "test/**/test_helper.exs"
"test/**/*_test.exs")
:program nil
:name "mix test")
Running it, it ignores any set up breakpoint and terminates with an
error:
Started ElixirLS debugger
Elixir version: "1.9.2 (compiled with Erlang/OTP 22)"
Erlang version: "22"
(Debugger) Initialization failed because an exception was raised:
** (RuntimeError) could not lookup Ecto repo Journey.Data.Repo because it was not started or it does not exist
Elixir.Ecto.Repo.Registry.erl:19: Ecto.Repo.Registry.lookup/1
Elixir.Ecto.Adapter.erl:127: Ecto.Adapter.lookup_meta/1
Elixir.Ecto.Adapters.SQL.Sandbox.erl:487: Ecto.Adapters.SQL.Sandbox.lookup_meta!/1
Elixir.Ecto.Adapters.SQL.Sandbox.erl:388: Ecto.Adapters.SQL.Sandbox.mode/2
11:29:44.316 [error] Process #PID<0.112.0> raised an exception
** (RuntimeError) could not lookup Ecto repo Journey.Data.Repo because it was not started or it does not exist
Elixir.Ecto.Repo.Registry.erl:19: Ecto.Repo.Registry.lookup/1
Elixir.Ecto.Adapter.erl:127: Ecto.Adapter.lookup_meta/1
Elixir.Ecto.Adapters.SQL.Sandbox.erl:487: Ecto.Adapters.SQL.Sandbox.lookup_meta!/1
Elixir.Ecto.Adapters.SQL.Sandbox.erl:388: Ecto.Adapters.SQL.Sandbox.mode/2
Do anyone knows how can I make it running? As I understand it the
problems is that when the code for the tests is evaluated, probably
the code that starts the Ecto’s Repo process has yet to be executed,
but I don’t know why and I haven’t found any clear explanantion.
In the meantime, I’ve tried also the :debugger way as suggested in
this
thread,
but without success.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
oolon
I’m also running into this. Shouldn’t the repo be started by
application.exwhen mix is run?oolon
All tests need to pass for the dap session to run successfully. @azazel75 make sure
mix testcan run successfully.azazel75
… I’m trying to debug a test because a test during
mix testrun failsazazel75
See the issue on ElixirLS repo