Closed marijanp closed 2 years ago
UPDATE
I received an answer to my proposal. Somebody is already working on a nice integrated solution using a monadic wrapper around CTLs Contract
monad see
@CSVdB @epiro-ps I connected with Vitaly today (he is actively working on this) and I will start to help him out starting tomorrow.
@CSVdB @epiro-ps From what I've seen today this plutip integration will also abstract away the proper runtime configuration. This means that the code in the above mentioned branch launches all the required runtime dependencies like ogmios, ogmios-datum-cache, etc. and configures them properly (no docker involved, everything runs in separate processes). And everything will be usable in PS through a monad.
I marked this as blocked as it's pending CTL maintainers to merge this PR. Let me know if this is incorrect.
https://github.com/Plutonomicon/cardano-transaction-lib/pull/470
I just posted a comment on the CTL discord asking them to communicate remaining tasks. It's not clear what the current status is on their end.
https://discord.com/channels/922576618424250418/940666072208662628
This is a more granular blocker:
https://github.com/Plutonomicon/cardano-transaction-lib/pull/663
At last the plutip integration is merged!
https://github.com/Plutonomicon/cardano-transaction-lib/pull/470
Introduction
I'm opening this issue to document my research on finding a way to do local e2e tests with
CTL
.The current state of testing of
CTL
offchain codeThe current state is to connect to launch a
runtime
i.e. a network of docker-containsers, including one forcardano-node
, which connects totestnet
in the background, and then run yourctl
application. This is obviously impure, stateful and inpractical.A temporary quick solution
There is a project called
plutip
maintained by mlabs which provides a library that implements atasty
-like test hook calledwithCluster
which launches a local cluster on every test-case. It also exports an executablelocal-cluster
which is a standalone local testnet launcher. Using thislocal-cluster
executable in the previously mentionedruntime
we are at least able to get a pure testing environment. We will be able to write a custom hook for our tests, which launches that runtime and tears it down for every test-case.There are already some efforts (see) towards integrating plutip. Please take a look at my comment to see what changes would be required to make that temporary solution work.