Skip to content

Commit

Permalink
Make hard fork era configurable in local test cluster
Browse files Browse the repository at this point in the history
Run integration tests for both allegra and mary eras
  • Loading branch information
rvl committed Jan 12, 2021
1 parent 3147629 commit cd32e14
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 95 deletions.
2 changes: 1 addition & 1 deletion lib/shelley/bench/Latency.hs
Expand Up @@ -403,7 +403,7 @@ withShelleyServer tracers action = do
let db = dir </> "wallets"
createDirectory db
let logCfg = LogFileConfig Error Nothing Error
let clusterCfg = LocalClusterConfig [] logCfg
let clusterCfg = LocalClusterConfig [] maxBound logCfg
withCluster nullTracer dir clusterCfg $
onClusterStart act dir

Expand Down
1 change: 1 addition & 0 deletions lib/shelley/cardano-wallet.cabal
Expand Up @@ -236,6 +236,7 @@ test-suite integration
, either
, filepath
, hspec
, hspec-core
, http-client
, iohk-monitoring
, lobemo-backend-ekg
Expand Down
36 changes: 22 additions & 14 deletions lib/shelley/exe/shelley-test-cluster.hs
Expand Up @@ -178,24 +178,32 @@ import qualified Data.Text as T
-- There are several environment variables that can be set to make debugging
-- easier if needed:
--
-- - CARDANO_WALLET_PORT: choose a port for the API to listen on (default: random)
-- - CARDANO_WALLET_PORT (default: random)
-- choose a port for the API to listen on
--
-- - CARDANO_NODE_TRACING_MIN_SEVERITY: increase or decrease the logging
-- severity of the nodes. (default: Info)
-- - CARDANO_NODE_TRACING_MIN_SEVERITY (default: Info)
-- increase or decrease the logging severity of the nodes.
--
-- - CARDANO_WALLET_TRACING_MIN_SEVERITY: increase or decrease the logging
-- severity of cardano-wallet. (default: Info)
-- - CARDANO_WALLET_TRACING_MIN_SEVERITY (default: Info)
-- increase or decrease the logging severity of cardano-wallet.
--
-- - TESTS_TRACING_MIN_SEVERITY: increase or decrease the logging severity of
-- the test cluster framework. (default: Notice)
-- - TESTS_TRACING_MIN_SEVERITY (default: Notice)
-- increase or decrease the logging severity of the test cluster framework.
--
-- - NO_POOLS: If set, the cluster will only start a BFT leader and a relay, no
-- stake pools. This can be used for running test scenarios which do
-- not require delegation-specific features without paying the
-- startup cost of creating and funding pools.
-- - TEST_CLUSTER_ERA (default: Mary)
-- By default, the cluster will start in the latest era by enabling
-- "virtual hard forks" in the node config files.
-- The final era can be changed with this variable.
--
-- - NO_CLEANUP: If set, the temporary directory used as a state directory for
-- nodes and wallet data won't be cleaned up.
-- - NO_POOLS (default: stake pools nodes are started and registered)
-- If set, the cluster will only start a BFT leader and a relay, no
-- stake pools. This can be used for running test scenarios which do
-- not require delegation-specific features without paying the
-- startup cost of creating and funding pools.
--
-- - NO_CLEANUP (default: temp files are cleaned up)
-- If set, the temporary directory used as a state directory for
-- nodes and wallet data won't be cleaned up.
main :: IO ()
main = withLocalClusterSetup $ \dir clusterLogs walletLogs ->
withLoggingNamed "test-cluster" clusterLogs $ \(_, (_, trCluster)) -> do
Expand Down Expand Up @@ -223,7 +231,7 @@ main = withLocalClusterSetup $ \dir clusterLogs walletLogs ->
let tracers = setupTracers (tracerSeverities (Just Debug)) tr
let db = dir </> "wallets"
createDirectory db
listen <- walletListenFromEnv
listen <- walletListenFromEnv Nothing

prometheusUrl <- (maybe "none"
(\(h, p) -> T.pack h <> ":" <> toText @(Port "Prometheus") p)
Expand Down

0 comments on commit cd32e14

Please sign in to comment.