[Proposal] - Add `ExUnit.rerun(list_of_modules)` to support rerunning test module in Livebook

53 views
Skip to first unread message

choon...@gmail.com

unread,
Apr 13, 2022, 8:19:49 PM4/13/22
to elixir-lang-core
Hi all,

I would like to propose `ExUnit.rerun(list_of_modules)` to rerun test modules.

Use Case
As far as I could think off, it is only useful in the context of Livebook notebook.

Often times, when writing a tutorial in Livebook, I want to write a test case for
the users so they could interactively write some code to make it pass. This is especially
helpful when we use Livebook as a teaching medium.

Currently, there are no ways to support ruruning a test without rewriting it. I have tried using Livebook branch out section but have no luck as well.

Current Hack
Currently, one can still achieve that by using Module.create/3 with ExUnit.run/1. Here's a Livebook notebook to demonstrate it, or you can run it here.

This work since we are essentially defining a "new" module.

Minimal working changes
Here's a gist that I quickly hack on to implement it. It's not perfect but seems to be working.

The Livebook twitter account suggested sending a PR here, but I guess let me propose it here first.

José Valim

unread,
Apr 17, 2022, 3:29:55 AM4/17/22
to elixir-lang-core
A pull request will be very welcome indeed!

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/2e69207c-15e6-4bdf-8461-dad727746d31n%40googlegroups.com.

Manish sharma

unread,
Apr 19, 2022, 3:17:55 AM4/19/22
to elixir-lang-core
Hi, I am a new member of this group. If you want to start your business in fantasy sports You must need to know about the Fantasy Cricket App Development [Cost+Features]. I hope this is very interesting for you. 
Reply all
Reply to author
Forward
0 new messages