zachallaun
I’d like to announce Mneme, a snapshot testing tool I’ve been working on.
I’ll keep this post short for now. This has been a lot of fun to work on and I hope that others find it useful! Please feel free to post any comments/feedback here, or issues on GitHub.
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
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
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
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
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
tcoopman
This looks great! Thanks for the library.
The GitHub link doesn’t seem to work though?
zachallaun
Fixed!
mindreframer
@zachallaun this looks great! I’ve tried it and so far this looks promising. I have one question though:
the interactive dots during the test suite run only appear at once after everything is finished. On bigger codebases this would be a no-go, since the immediate test feedback is really important here.
Is there a way to bring this “progress-bar” feeling back?
Also nice that you link to https://insta.rs/ and GitHub - janestreet/ppx_expect: Cram like framework for OCaml · GitHub , the ideas behind those libraries are quite cool!
More links, if anyone is interested:
zachallaun
Thank you so much for trying it out and for the question!
To make sure I better understand, are the dots appearing all at the end even when there are no prompts from Mneme? If so, that’s a bug and can/should be fixed. It’s currently expected that nothing will appear during prompting, however, even though async tests are continuing to run in the background — I’m currently suppressing output to prevent garbled terminals during prompting.
One possible solution I explored was a “raw mode” TTY, so that Mneme would have full control over the terminal and get keys on press instead of on-enter. This turns out to be a really tricky problem in Elixir/Erlang, however, though some changes coming with OTP 26 might make it easier in the future.
zachallaun
This article and discussion is what got me working on this.
I’ll add an “additional reading” section to the docs with some of this. Thanks for sharing here!
mindreframer
I mean the test run without any prompts, it looks like the process is hanging and then all the dots appear at once.
Raw TTY sounds indeed like a challenging problem, especially with async tests running. I currently do not a good idea how to approach it. Should I open an issue on the repo with a reproducible example?
zachallaun
If you have one, that would be great! Thank you!
mindreframer
Hey @zachallaun , here is a small demo:
I run tests in IEx, so I’ve adjusted mneme to restart on
Mneme.start()fn call.zachallaun
Thanks so much for the demo! I’ll see what can be done.
zachallaun
@mindreframer I’ve just published
0.1.1, which pretty dramatically reduces the performance gap betweenauto_assertandassert. If you are able to give it a try and let me know what issues persist, I’d greatly appreciate it.This was most definitely worth pursuing! Your demo made is super clear just how slow
auto_assertwas compared to normal asserts.My intuition about compile-time vs. runtime costs was wrong in the context of
.exs, since all compile-time costs are incurred every time you run the test. By dramatically simplifying the code that theauto_assertmacro produces, an unscientific benchmark of running a test with 100 generated auto-asserts goes from taking ~3 seconds to taking 0.2s (compared to 0.05s for normal asserts).