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.

1 Like

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:

2 Likes

:wave: Any progress on that? :wink:

2 Likes

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

1 Like

I’ll probably need that, so I think I’ll just use a markdown parser to extract the code snippets and concatenate them together. Should be easy unless I’m missing something :thinking: