-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathTestnet.purs
50 lines (45 loc) · 1.55 KB
/
Testnet.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
module Test.Ctl.Testnet
( main
) where
import Prelude
import Contract.Test.Testnet (defaultTestnetConfig, testTestnetContracts)
import Contract.Test.Utils (exitCode, interruptOnSignal)
import Data.Maybe (Maybe(Just))
import Data.Posix.Signal (Signal(SIGINT))
import Effect (Effect)
import Effect.Aff
( Milliseconds(Milliseconds)
, cancelWith
, effectCanceler
, launchAff
)
import Mote (group)
import Mote.TestPlanM as Utils
import Test.Ctl.Testnet.Contract.OgmiosMempool as OgmiosMempool
import Test.Spec.Runner (defaultConfig)
-- Run with `npm run testnet-test`
main :: Effect Unit
main = interruptOnSignal SIGINT =<< launchAff do
let config = defaultTestnetConfig
flip cancelWith (effectCanceler (exitCode 1)) do
Utils.interpretWithConfig
defaultConfig { timeout = Just $ Milliseconds 70_000.0, exit = true }
$ group "cardano-testnet" do
testTestnetContracts config OgmiosMempool.suite
-- FIXME: ClusterParameters.runTest
{-
configWithMaxExUnits :: PlutipConfig
configWithMaxExUnits = config
{ clusterConfig = config.clusterConfig { raiseExUnitsToMax = true } }
testStartPlutipCluster :: TestPlanM (Aff Unit) Unit
testStartPlutipCluster = group "Server" do
test "startPlutipCluster / stopPlutipCluster" do
bracket (startPlutipServer config)
(stopChildProcessWithPort config.port) $ const do
checkPlutipServer config
_startRes <- startPlutipCluster config [ [] ]
stopRes <- stopPlutipCluster config
stopRes `shouldSatisfy` case _ of
StopClusterSuccess -> true
_ -> false
-}