Skip to content

Commit

Permalink
Add PARALLEL_TESTNETS flag
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer authored and mgmeier committed May 8, 2024
1 parent 1c67ce1 commit 6303ebc
Showing 1 changed file with 52 additions and 42 deletions.
94 changes: 52 additions & 42 deletions cardano-testnet/test/cardano-testnet-test/cardano-testnet-test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,55 +30,65 @@ import Test.Tasty (TestTree)
import qualified Test.Tasty.Ingredients as T

tests :: IO TestTree
tests = pure $ sequentialTestGroup "test/Spec.hs"
[ sequentialTestGroup "Spec"
[ sequentialTestGroup "Ledger Events"
[ H.ignoreOnWindows "Sanity Check" LedgerEvents.hprop_ledger_events_sanity_check
-- TODO: Replace foldBlocks with checkLedgerStateCondition
, T.testGroup "Governance"
-- FIXME Those tests are flaky
[ -- H.ignoreOnMacAndWindows "ProposeAndRatifyNewConstitution" LedgerEvents.hprop_ledger_events_propose_new_constitution
-- , H.ignoreOnWindows "InfoAction" LedgerEvents.hprop_ledger_events_info_action
H.ignoreOnWindows "ProposeNewConstitutionSPO" LedgerEvents.hprop_ledger_events_propose_new_constitution_spo
, H.ignoreOnWindows "DRepRetirement" DRepRetirement.hprop_drep_retirement
tests = do
testGroup <- runTestGroup <$> shouldRunInParallel
pure $ testGroup "test/Spec.hs"
[ testGroup "Spec"
[ testGroup "Ledger Events"
[ H.ignoreOnWindows "Sanity Check" LedgerEvents.hprop_ledger_events_sanity_check
-- TODO: Replace foldBlocks with checkLedgerStateCondition
, testGroup "Governance"
-- FIXME Those tests are flaky
[ -- H.ignoreOnMacAndWindows "ProposeAndRatifyNewConstitution" LedgerEvents.hprop_ledger_events_propose_new_constitution
-- , H.ignoreOnWindows "InfoAction" LedgerEvents.hprop_ledger_events_info_action
H.ignoreOnWindows "ProposeNewConstitutionSPO" LedgerEvents.hprop_ledger_events_propose_new_constitution_spo
, H.ignoreOnWindows "DRepRetirement" DRepRetirement.hprop_drep_retirement
]
, testGroup "Plutus"
[ H.ignoreOnWindows "PlutusV3" Cardano.Testnet.Test.Cli.Conway.Plutus.hprop_plutus_v3]
]
, testGroup "CLI"
[ H.ignoreOnWindows "Shutdown" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdown
-- ShutdownOnSigint fails on Mac with
-- "Log file: /private/tmp/tmp.JqcjW7sLKS/kes-period-info-2-test-30c2d0d8eb042a37/logs/test-spo.stdout.log had no logs indicating the relevant node has minted blocks."
, H.ignoreOnMacAndWindows "ShutdownOnSigint" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdownOnSigint
-- ShutdownOnSlotSynced FAILS Still. The node times out and it seems the "shutdown-on-slot-synced" flag does nothing
-- , H.ignoreOnWindows "ShutdownOnSlotSynced" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdownOnSlotSynced
, testGroup "Babbage"
[ H.ignoreOnMacAndWindows "leadership-schedule" Cardano.Testnet.Test.Cli.Babbage.LeadershipSchedule.hprop_leadershipSchedule -- FAILS
, H.ignoreOnWindows "stake-snapshot" Cardano.Testnet.Test.Cli.Babbage.StakeSnapshot.hprop_stakeSnapshot
, H.ignoreOnWindows "transaction" Cardano.Testnet.Test.Cli.Babbage.Transaction.hprop_transaction
]
, T.testGroup "Plutus"
[ H.ignoreOnWindows "PlutusV3" Cardano.Testnet.Test.Cli.Conway.Plutus.hprop_plutus_v3]
-- TODO: Conway - Re-enable when create-staked is working in conway again
--, testGroup "Conway"
-- [ H.ignoreOnWindows "stake-snapshot" Cardano.Testnet.Test.Cli.Conway.StakeSnapshot.hprop_stakeSnapshot
-- ]
-- Ignored on Windows due to <stdout>: commitBuffer: invalid argument (invalid character)
-- as a result of the kes-period-info output to stdout.
, H.ignoreOnWindows "kes-period-info" Cardano.Testnet.Test.Cli.KesPeriodInfo.hprop_kes_period_info
, H.ignoreOnWindows "query-slot-number" Cardano.Testnet.Test.Cli.QuerySlotNumber.hprop_querySlotNumber
, H.ignoreOnWindows "foldBlocks receives ledger state" Cardano.Testnet.Test.FoldBlocks.prop_foldBlocks
]
, sequentialTestGroup "CLI"
[ H.ignoreOnWindows "Shutdown" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdown
-- ShutdownOnSigint fails on Mac with
-- "Log file: /private/tmp/tmp.JqcjW7sLKS/kes-period-info-2-test-30c2d0d8eb042a37/logs/test-spo.stdout.log had no logs indicating the relevant node has minted blocks."
, H.ignoreOnMacAndWindows "ShutdownOnSigint" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdownOnSigint
-- ShutdownOnSlotSynced FAILS Still. The node times out and it seems the "shutdown-on-slot-synced" flag does nothing
-- , H.ignoreOnWindows "ShutdownOnSlotSynced" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdownOnSlotSynced
, sequentialTestGroup "Babbage"
[ H.ignoreOnMacAndWindows "leadership-schedule" Cardano.Testnet.Test.Cli.Babbage.LeadershipSchedule.hprop_leadershipSchedule -- FAILS
, H.ignoreOnWindows "stake-snapshot" Cardano.Testnet.Test.Cli.Babbage.StakeSnapshot.hprop_stakeSnapshot
, H.ignoreOnWindows "transaction" Cardano.Testnet.Test.Cli.Babbage.Transaction.hprop_transaction

]
, testGroup "SubmitApi"
[ testGroup "Babbage"
[ H.ignoreOnWindows "transaction" Cardano.Testnet.Test.SubmitApi.Babbage.Transaction.hprop_transaction
]
-- TODO: Conway - Re-enable when create-staked is working in conway again
--, sequentialTestGroup "Conway"
-- [ H.ignoreOnWindows "stake-snapshot" Cardano.Testnet.Test.Cli.Conway.StakeSnapshot.hprop_stakeSnapshot
-- ]
-- Ignored on Windows due to <stdout>: commitBuffer: invalid argument (invalid character)
-- as a result of the kes-period-info output to stdout.
, H.ignoreOnWindows "kes-period-info" Cardano.Testnet.Test.Cli.KesPeriodInfo.hprop_kes_period_info
, H.ignoreOnWindows "query-slot-number" Cardano.Testnet.Test.Cli.QuerySlotNumber.hprop_querySlotNumber
, H.ignoreOnWindows "foldBlocks receives ledger state" Cardano.Testnet.Test.FoldBlocks.prop_foldBlocks
]
]

]
, sequentialTestGroup "SubmitApi"
[ sequentialTestGroup "Babbage"
[ H.ignoreOnWindows "transaction" Cardano.Testnet.Test.SubmitApi.Babbage.Transaction.hprop_transaction
]
]
]
shouldRunInParallel :: IO Bool
shouldRunInParallel = (== Just "1") <$> E.lookupEnv "PARALLEL_TESTNETS"

-- FIXME Right now when running tests concurrently it makes them flaky
sequentialTestGroup :: T.TestName -> [TestTree] -> TestTree
sequentialTestGroup name = T.sequentialTestGroup name T.AllFinish
runTestGroup
:: Bool -- ^ True to run in parallel
-> T.TestName
-> [TestTree]
-> TestTree
runTestGroup True name = T.testGroup name
runTestGroup False name = T.sequentialTestGroup name T.AllFinish

ingredients :: [T.Ingredient]
ingredients = T.defaultIngredients
Expand Down

0 comments on commit 6303ebc

Please sign in to comment.