Skip to content

Commit 66c7734

Browse files
committed
Add option to run tests with lsm
1 parent 11947c3 commit 66c7734

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • cardano-chain-gen/test/Test/Cardano/Db/Mock

cardano-chain-gen/test/Test/Cardano/Db/Mock/Config.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,15 @@ withConfig staticDir mutableDir cmdLineArgs config action = do
281281
{-# ANN withConfig ("HLint: ignore Redundant pure" :: String) #-}
282282

283283
mkSyncNodeConfig :: FilePath -> CommandLineArgs -> IO SyncNodeConfig
284-
mkSyncNodeConfig configFilePath cmdLineArgs =
285-
readSyncNodeConfig $ mkConfigFile configDir configFilename
284+
mkSyncNodeConfig configFilePath cmdLineArgs = do
285+
cfg <- readSyncNodeConfig $ mkConfigFile configDir configFilename
286+
-- Allow env-var override of the ledger backend so CI can run the
287+
-- full suite against both "inmemory" and "lsm" without per-test config changes.
288+
mBackend <- lookupEnv "DB_SYNC_TEST_LEDGER_BACKEND"
289+
pure $ case mBackend of
290+
Just "lsm" -> cfg {dncLedgerBackend = LedgerBackendLSM Nothing}
291+
Just "inmemory" -> cfg {dncLedgerBackend = LedgerBackendInMemory}
292+
_ -> cfg
286293
where
287294
configFilename = claConfigFilename cmdLineArgs
288295
configDir = mkConfigDir configFilePath

0 commit comments

Comments
 (0)