dwyl / learn-phoenix

:fire: Phoenix is the web framework without compromise on speed, reliability or maintainability! Don't settle for less. :rocket:
650 stars 45 forks source link

Add debugging section #75

Open samhstn opened 7 years ago

samhstn commented 7 years ago

A great introduction to debugging: https://www.youtube.com/watch?v=EBbSM6DSZnA Another good resource: https://medium.com/@diamondgfx/debugging-phoenix-with-iex-pry-5417256e1d11

Command to debug tests:

iex -S mix test --trace

(mix help test to see info on this)

Ensure your database wont timeout when debugging tests by adding an ownership timeout in your config/test.exs: (Otherwise you will lose your database connection in 15 seconds when paused in IEx)

  ...
  pool: Ecto.Adapters.SQL.Sandbox,
  ownership_timeout: 10 * 60 * 1000 # 10 mins

Command to debug server:

iex -S mix phoenix.server

That's everything I think you need to know tbh