binarypaladin

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?

Showing Posts 1 to 5

sodapopcan

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

binarypaladin OP

lol. I liiterally learned about dbg today 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

sodapopcan

I remember when dbg first 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

rvirding

Creator of Erlang

In these discussions I always mix up Erlang dbg, :dbg, and Elixir dbg. :laughing:

binarypaladin

binarypaladin OP

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.pry to work in a tests I’d have to do this:

iex -S mix test /path/to/test.exs

That is no longer required.

This:

mix test /path/to/test.exs

Will open up an iex terminal with pry if IEX.pry() is in the code. Otherwise, it will ignore it and not just open an iex terminal at the end. This was the functionality I was looking for in this post anyway.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews