< all work · 04 / 05

Elek

An incremental test runner for Dart and Flutter that skips what is already green, so coding agents can verify their changes in seconds.

Role
Design, Development, Dart
Status
0.1, experimental, on pub.dev
Stack
Dart · Flutter · Claude Code plugin · Codex plugin
Links
pub.dev ↗ · GitHub ↗
Elek cover
  • 107×faster when nothing changed (192.5 → 1.8 s)
  • 49×faster after one test file changed
  • 12×faster after a controller changed

Private Flutter app, 265 test files, 2,230 tests, Apple M3, median of 3 runs.

01 The problem

Coding agents are fast; test suites aren’t. A full flutter test run on a real app took over three minutes, so agents either skipped verification or spent most of their time waiting on it.

02 What I built

Elek fingerprints the inputs of every test file (its transitive import closure, fixtures, pubspec and lockfile, assets, SDK versions, locale and time zone) and skips files that passed last time with the same inputs.

What’s left runs in a few bundled shards balanced by past durations, so the compiler starts a handful of times instead of once per file. A file that fails in a bundle is rerun alone, so leaking global state can’t produce a false result.

A plugin for Claude Code and Codex adds a hook that runs Elek when the agent tries to finish. Failing tests go back to the agent; it stops at most three times in a row so a pre-existing failure can’t trap it.

03 Worth knowing

  • Elek means “sieve” in Turkish.
  • Benchmarks published with their limits: on Flame, a single import cycle means a source change still reruns most files.