Improve unit test performance and reliability
- Dominant language
- Go
- Stars
- 7
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Right now our unit tests are very slow and brittle due to the hard requirement of a L1 Full Node.
For each tested package, the test runner will start a new dockerized L1 node and return a proxy as a new L1 client. This is error prone, as the proxy doesn't always work correctly. Usually, because the proxy tries to bind to already open ports. Furthermore, starting and stopping L1 nodes takes a lot of time. Our unit tests used to be quite fast (below a minute), now we are at roughly 16mins+
After some research we figured that the Simulacrum is a good base to work with, as it provides the functionality of a L1 Full Node(for our requirements at least), without all the extras (Postgres, Indexer, Validator Nodes, etc).
It gives granular options to create new Checkpoints, Epochs, request funds, to set account balances, to execute transactions and get objects.
As the Simulacrum is written in Rust and is just a library, it seems our only option is to wrap the Simulacrum functions into a REST API.
A little bit of time was spent to expose its functionality via a native library wrapper, but this makes things too complicated.
The best case approach would therefore be, to:
* Expose a proper Full Node L1 REST API that is compatible to the real world API
* Expose a control API which allows us to control the Simulacrum (Create Checkpoints/Epochs, Request Funds)
* Integrate the Simulacrum node into our test suite
Contributor guide
Assessment
This issue has not been assessed yet.