mlabs-haskell / cardanow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Figure out a testing solution

nazrhom opened this issue · comments

Testing this project seems to be quite complex. We have to at least support a full integration test (this will take a long time as we have to fetch a node snapshot and then run the indexers on it) and some fast tests to help developers iterate quickly.

The integration tests should be relatively simple to setup as they follow the normal behaviour of the application. A full integration test should:

  • Fetch a snapshot of the cardano node from the mithril network
  • Spin up a node with this snapshot, and run all the supported indexers until they have computed their own snapshots (this should be done with the SnapshotExporter interface)
  • Upload all the snapshots to some server

The goal of these tests is simply to catch any changes in the external interfaces we rely on (mithril client, etc).

Developer tests instead might be a bit more involved, as we want to make the whole process as fast as possible. These can be split up into several units that test each part individually. The goal of these tests is to find any issues in our code, as such all calls to external services should mocked.
One idea would be to spin up a mithril network on a local devnet (with a suitably small database) so the process of fetching the data, and subsequently have the indexers process it, is fast.