[ANN] hegel-ocaml 0.25.0 - concurrent stateful property-based testing

Hello, we excited to announce hegel-ocaml 0.25.0!

Since our last announcement of hegel-ocaml 0.14.1, we’ve added concurrent stateful property-based testing and nondeterminism handling to Hegel. Stateful property based testing sequences actions (which we call rules) that mutate the state of some model and the system under test. The concurrent part comes from running rules concurrently. Hegel spins up some number of workers and distributes some number of rules to each worker. Rules within a worker run sequentially, but rules in different workers may run concurrently. Of course, this introduces nondeterminism since the workers can run in any order or suspend. To handle this, Hegel repeatedly replays failures and outputs the number of times the failure was reproduced. Nondeterminism handling can also be turned off, so any nondeterministic failure produces a flaky test error instead. Of course, running Hegel inside of Antithesis will give reproducible failures.

For an example of concurrent stateful testing, see the docs.

The unique feature of Hegel concurrent stateful tests is the ability to pass in different concurrency capabilities. Workers can be on threads, domains, or anything of the Concurrency.t type. We have included a thread capability and domains capability for your convenience. Hegel defaults to using threads.

With the hegel_jane_async sublibrary, Jane Street ecosystem users can also run sequential stateful tests whose rules are async (returning unit Deferred.t).

For OxCaml users, hegel-ocaml is fully compatible with OxCaml 5.2.0-minus39. With the hegel_jane_concurrent sublibrary, OxCaml users can also pass in concurrency capabilities from the Concurrent library. and run concurrent async stateful tests with hegel_jane_async.

Happy testing and contributing!

5 Likes