Motivation

A test framework for integration tests
Weaver was built for integration/end-to-end tests. It makes tests faster and easier to debug by using cats-effect IO.
- Tests are run concurrently by default for quickest results possible.
- Expectations (ie assertions) are composable values.
- Failures are aggregated and reported at the end of the run
- Logs are only displayed when a test fails. This works perfectly well with concurrent runs.
- “beforeAll” and “afterAll” logic is represented using a
cats.effect.Resource. This ensures that resources such as HTTP clients, connection pools and file handles are cleaned up correctly and predictably.
History
Weaver-test was born in 2018 as an experiment, trying to speedup an extremely slow, incredibly I/O heavy test suite that was implemented with scalatest, and was making numerous http calls to real services, verifying their deployments and orchestration.
Neither cats-effect nor fs2 had reached their respective 1.0.0 at the time.
Nevertheless, built on bleeding edge libraries, and offering a principled api that didn't completely shift from more classic frameworks such as utest, specs2, scalatest, etc, weaver allowed to tremendously speed up the test suite in question by parallelising its test, weaving their respective computations together in a single IO value that was executed by the framework.
From there, additional problems were tackled, among which :
- Making errors appear at the very end of the report, no matter how many suites were run.
- Ensuring a principled sharing of resources across tests, using
cats.effect.Resourceto guarantee their release. - Providing a lazy logger to enrich reporting with ad-hoc information, ensuring it only gets displayed when a test fails.
- Treating assertions as pure values that could be composed together, negated, discarded ...
Thank you note
A HUGE thank you to Alexandru Nedelcu, author of Monix and contributor to cats-effect, as he wrote the minitest framework which got this framework started.
Another HUGE thank you to Eugene Yokota, author of Expecty.
And an obvious thank you to the maintainers of cats and fs2. We stand on the shoulders of giants.