binarypaladin
When I am not touching front-end code, I pretty much live in the testing environment when doing development. I almost never drop into to dev at all. I find that since dev requires setting up state, why not just have a test case ready that has it and drop in using pry?
So, the start of my debugging often begins with:
iex -S mix test --trace /path/to/test:100
Or, since someone introduced me to dbg it’s turned into:
iex --dbg pry -S mix test --trace /path/to/test:100
I’m in the process of refining some little QoL things and one of the kinda annoying things in this flow is that an iex shell opens even in the absence of IEx.pry() or dbg(). It’s not the worst thing in world as a quick ctrl + c x2 gets me out of there. Still, is there a way to use the same command to only pop the iex session if I include some kind of pry?
The nice thing about this is that I always just use one command to figure off my single tests.
Is there a way to accomplish this?
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
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sodapopcan
Sorry I don’t have an answer but this is cool, thanks for giving me some stuff to look into! I wasn’t aware of
--dbg pry.binarypaladin
lol. I liiterally learned about
dbgtoday from a co-worker. My first thought was, “Okay, how long have I been a caveman?”The answer, as it turns out, is about one year and four months since Elixir 1.14 was released.
My second thought was, “Why haven’t I made a terminal alias for this yet?” That’s since been rectified.
The excellent improvements to all things error-related in 1.16 have had me thinking more and more about QoL as of late.
sodapopcan
I remember when
dbgfirst was introduced it pry’d by default but people didn’t like that. I just got used to it not doing it anymore once it was taken away, but obviously makes sense you still have the option, lol.rvirding
In these discussions I always mix up Erlang dbg,
:dbg, and Elixir dbg.binarypaladin
So… completely by accident, I noticed something changed with tests—I’m guessing in 1.16, although it might have been 1.15. This happened while messing with terminal aliases.
At some point, definitely in 1.14, in order to get
IEX.pryto work in a tests I’d have to do this:That is no longer required.
This:
Will open up an
iexterminal with pry ifIEX.pry()is in the code. Otherwise, it will ignore it and not just open aniexterminal at the end. This was the functionality I was looking for in this post anyway.