markmark206

markmark206

How do I test Livebooks in CI/CD?

I put together a Livebook that illustrates using a package. The Livebook has been a great addition to all the usual documentation, and great for showing folks how to use the package, and for making it easy to start playing with the package.

Just like with any code, I want to make sure to catch “regressions” in my Livebook, as early and as inexpensively as possible. Of course, I can always just execute my Livebook by hand, step by step, but that is an expensive and error-prone proposition (times the # of commits, times the # of Livebooks), and it would be great if my CI/CD system could do that for me automatically, doctest-style.

Which brings me to my question: are there patterns (or ideas for patterns) for testing Livebooks in CI/CD?

Thank you (and thank you for the great tool, Jonatan and José!),
Mark.

Marked As Solved

josevalim

josevalim

Creator of Elixir

There is no such option right now. Our goal is to have an export to Elixir script option, so you can get only the code out, and we can make it available via the command line. Then you can invoke it, execute it, and match on the result.

You should also be able to replicate this by getting the .livemd file and extracting the Elixir snippets. It shouldn’t be hard. :slight_smile:

Also Liked

mat-hek

mat-hek

Membrane Core Team

:wave: Any progress on that? :wink:

josevalim

josevalim

Creator of Elixir

Not yet but if someone wants to work on this, please let us know. :slight_smile:

thbar

thbar

Sharing a bit of feedback on this: I’m faced with an increasing number of situations where I have multiple livebooks in one repository, so brainstorming a bit how to ensure consistency at the PR, CI/CD level.

Typical needs I’m facing at the moment:

  • ensuring that file paths are not broken (quite easy by parsing the .livemd, but indeed a “–check” CLI option would be lovely)
  • ensuring that the code (some being shared between livebooks when it’s generic enough, some being specific) does not break (for this I currently extract livebooks code into proper components, and reduce the code present in the livebooks themselves to the minimum)

Happy to bounce ideas with others here!

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement