funboy

funboy

Making Large Elixir Test Suites Faster with Check

Hi,

I built a small utility tool mainly for running test partitions, generating coverage reports, and rerunning failed tests across all partitions.
I managed to speed up test suite from 20min down to 6min :smiley:

check --green run

Why a binary instead of a Mix task?

When you run a Mix task, you often have to wait for the whole project to compile first, especially in large projects. Sometimes you’re waiting longer for compilation than for the task itself.

check avoids that completely. It’s an escript binary that directly runs the commands it needs.

The main feature is test partitioning.

Instead of running all tests one after another, check splits them into multiple partitions and runs them in parallel.

check                # runs tests in 3 partitions by default
check --partitions 6 # use more partitions on bigger machines

Coverage is merged automatically after all partitions finish.

You can also run only tests affected by your changes:

check --only modified_tests

This is quite granular. If you change a single test, only that test is run. If you change a describe setup, only tests in that block are run.

You can find a guide on how to set up your project to run tests using partitions here :crossed_fingers:

Maybe some of you will find it useful too :grinning_face_with_smiling_eyes:

Most Liked

Where Next?

Popular in Dev Env & Tools Top

renews
Hello everyone, today I created a simple Neovim plugin to check for new versions of packages used in the project, not sure if it is usefu...
New
funboy
Hi, I built a small utility tool mainly for running test partitions, generating coverage reports, and rerunning failed tests across all ...
New
sodapopcan
I just placed on an order for my first mechanical watch since I last wore one in my mid 20s which was… oh boy, technically decadeS ago (t...
New
bwlang
I want to buld this docker image but it fails with a timeout at RUN mix local.hex --force Maybe it’s just a maintenance window, but the...
New
jpease
If it’s useful to anyone, here’s a tiny nvim plugin (jpease/hex-outdated.nvim) that shows drift between your mix.exs and packages on hex....
New
New
JoeZMar
After the keyboard thread has convinced me to purchase a UHK I wanted to make one about the mouse. Switching to a programmable keyboard h...
New
AstonJ
How fast is your internet connection? (And how much do you pay?) You can test via www.speedtest.net and to embed results into your post...
New
AstonJ
What are you using for software dev? Can you share what you like/dislike about it? Would you recommend it to others? Related thread: Ho...
New
AstonJ
Following on from part of the discussion in the Digital Nomads & Frequent Travellers (Tips/Advice/Chat) thread, I thought it might be...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
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
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement