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:

First 4 of 4 Posts Switch mode

funboy

funboy OP

Hi,

I’ve enhanced the check tool with dense coverage.

Problem:

Coverage output is too noisy. On large projects, it prints percentages for thousands of modules, even if I only changed a handful of files. The information I care about gets lost in the noise.

Solution:

al_check now diffs against the base branch and reports coverage only for new and modified files, grouped by change type with per-group average coverage.

Try it


  {:al_check, "~> 0.1.24"}

  mix deps.get
  mix check.install   # or: mix check.build && ./deps/al_check/scripts/check
  check               # run everything, get the change-scoped coverage report

more details → Coverage you’ll actually read

funboy

funboy OP

btw, is anyone here using the check tool? :grinning_face_with_smiling_eyes:

funboy

funboy OP

Yep, ex_check is great! I was just missing a few features, like running tests in partitions and using a prebuilt binary to avoid compiling the project before the first check starts. That’s why I ended up building my own tool :smiley:

— All posts loaded —

Where Next?

Trending in Dev Env & Tools Top

dimitarvp
Yeah, feels the same here. :confused: And I made a much bigger investment, the iMac Pro I got was $8000 at the time I bought it (2019). ...
New
mikehostetler
TL;DR; Best practices for shipping an ecosystem of connector packages to Hex in a responsible way? Background I have a project, jido_c...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement