Runic.Runner.Scheduler.ContractTest (Runic v0.1.0-alpha.7)

Copy Markdown View Source

Conformance test suite for Runic.Runner.Scheduler behaviour implementations.

Verifies that a scheduler correctly implements the dispatch contract:

  • init/1 returns {:ok, state}
  • plan_dispatch/3 returns well-formed dispatch units
  • All input runnables are accounted for (no dropped runnables)
  • No duplicate runnables across dispatch units
  • No overlapping node_hashes between dispatch units
  • Promise node_hashes are supersets of their runnable hashes
  • Empty input produces empty output
  • State is properly threaded across calls

Usage

defmodule MySchedulerTest do
  use Runic.Runner.Scheduler.ContractTest,
    scheduler: MyApp.CustomScheduler,
    opts: [my_option: true]
end