@@ -30,55 +30,65 @@ import Test.Tasty (TestTree)
3030import qualified Test.Tasty.Ingredients as T
3131
3232tests :: IO TestTree
33- tests = pure $ sequentialTestGroup " test/Spec.hs"
34- [ sequentialTestGroup " Spec"
35- [ sequentialTestGroup " Ledger Events"
36- [ H. ignoreOnWindows " Sanity Check" LedgerEvents. hprop_ledger_events_sanity_check
37- -- TODO: Replace foldBlocks with checkLedgerStateCondition
38- , T. testGroup " Governance"
39- -- FIXME Those tests are flaky
40- [ -- H.ignoreOnMacAndWindows "ProposeAndRatifyNewConstitution" LedgerEvents.hprop_ledger_events_propose_new_constitution
41- -- , H.ignoreOnWindows "InfoAction" LedgerEvents.hprop_ledger_events_info_action
42- H. ignoreOnWindows " ProposeNewConstitutionSPO" LedgerEvents. hprop_ledger_events_propose_new_constitution_spo
43- , H. ignoreOnWindows " DRepRetirement" DRepRetirement. hprop_drep_retirement
33+ tests = do
34+ testGroup <- runTestGroup <$> shouldRunInParallel
35+ pure $ testGroup " test/Spec.hs"
36+ [ testGroup " Spec"
37+ [ testGroup " Ledger Events"
38+ [ H. ignoreOnWindows " Sanity Check" LedgerEvents. hprop_ledger_events_sanity_check
39+ -- TODO: Replace foldBlocks with checkLedgerStateCondition
40+ , testGroup " Governance"
41+ -- FIXME Those tests are flaky
42+ [ -- H.ignoreOnMacAndWindows "ProposeAndRatifyNewConstitution" LedgerEvents.hprop_ledger_events_propose_new_constitution
43+ -- , H.ignoreOnWindows "InfoAction" LedgerEvents.hprop_ledger_events_info_action
44+ H. ignoreOnWindows " ProposeNewConstitutionSPO" LedgerEvents. hprop_ledger_events_propose_new_constitution_spo
45+ , H. ignoreOnWindows " DRepRetirement" DRepRetirement. hprop_drep_retirement
46+ ]
47+ , testGroup " Plutus"
48+ [ H. ignoreOnWindows " PlutusV3" Cardano.Testnet.Test.Cli.Conway.Plutus. hprop_plutus_v3]
49+ ]
50+ , testGroup " CLI"
51+ [ H. ignoreOnWindows " Shutdown" Cardano.Testnet.Test.Node.Shutdown. hprop_shutdown
52+ -- ShutdownOnSigint fails on Mac with
53+ -- "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."
54+ , H. ignoreOnMacAndWindows " ShutdownOnSigint" Cardano.Testnet.Test.Node.Shutdown. hprop_shutdownOnSigint
55+ -- ShutdownOnSlotSynced FAILS Still. The node times out and it seems the "shutdown-on-slot-synced" flag does nothing
56+ -- , H.ignoreOnWindows "ShutdownOnSlotSynced" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdownOnSlotSynced
57+ , testGroup " Babbage"
58+ [ H. ignoreOnMacAndWindows " leadership-schedule" Cardano.Testnet.Test.Cli.Babbage.LeadershipSchedule. hprop_leadershipSchedule -- FAILS
59+ , H. ignoreOnWindows " stake-snapshot" Cardano.Testnet.Test.Cli.Babbage.StakeSnapshot. hprop_stakeSnapshot
60+ , H. ignoreOnWindows " transaction" Cardano.Testnet.Test.Cli.Babbage.Transaction. hprop_transaction
4461 ]
45- , T. testGroup " Plutus"
46- [ H. ignoreOnWindows " PlutusV3" Cardano.Testnet.Test.Cli.Conway.Plutus. hprop_plutus_v3]
62+ -- TODO: Conway - Re-enable when create-staked is working in conway again
63+ -- , testGroup "Conway"
64+ -- [ H.ignoreOnWindows "stake-snapshot" Cardano.Testnet.Test.Cli.Conway.StakeSnapshot.hprop_stakeSnapshot
65+ -- ]
66+ -- Ignored on Windows due to <stdout>: commitBuffer: invalid argument (invalid character)
67+ -- as a result of the kes-period-info output to stdout.
68+ , H. ignoreOnWindows " kes-period-info" Cardano.Testnet.Test.Cli.KesPeriodInfo. hprop_kes_period_info
69+ , H. ignoreOnWindows " query-slot-number" Cardano.Testnet.Test.Cli.QuerySlotNumber. hprop_querySlotNumber
70+ , H. ignoreOnWindows " foldBlocks receives ledger state" Cardano.Testnet.Test.FoldBlocks. prop_foldBlocks
4771 ]
48- , sequentialTestGroup " CLI"
49- [ H. ignoreOnWindows " Shutdown" Cardano.Testnet.Test.Node.Shutdown. hprop_shutdown
50- -- ShutdownOnSigint fails on Mac with
51- -- "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."
52- , H. ignoreOnMacAndWindows " ShutdownOnSigint" Cardano.Testnet.Test.Node.Shutdown. hprop_shutdownOnSigint
53- -- ShutdownOnSlotSynced FAILS Still. The node times out and it seems the "shutdown-on-slot-synced" flag does nothing
54- -- , H.ignoreOnWindows "ShutdownOnSlotSynced" Cardano.Testnet.Test.Node.Shutdown.hprop_shutdownOnSlotSynced
55- , sequentialTestGroup " Babbage"
56- [ H. ignoreOnMacAndWindows " leadership-schedule" Cardano.Testnet.Test.Cli.Babbage.LeadershipSchedule. hprop_leadershipSchedule -- FAILS
57- , H. ignoreOnWindows " stake-snapshot" Cardano.Testnet.Test.Cli.Babbage.StakeSnapshot. hprop_stakeSnapshot
58- , H. ignoreOnWindows " transaction" Cardano.Testnet.Test.Cli.Babbage.Transaction. hprop_transaction
72+
73+ ]
74+ , testGroup " SubmitApi"
75+ [ testGroup " Babbage"
76+ [ H. ignoreOnWindows " transaction" Cardano.Testnet.Test.SubmitApi.Babbage.Transaction. hprop_transaction
5977 ]
60- -- TODO: Conway - Re-enable when create-staked is working in conway again
61- -- , sequentialTestGroup "Conway"
62- -- [ H.ignoreOnWindows "stake-snapshot" Cardano.Testnet.Test.Cli.Conway.StakeSnapshot.hprop_stakeSnapshot
63- -- ]
64- -- Ignored on Windows due to <stdout>: commitBuffer: invalid argument (invalid character)
65- -- as a result of the kes-period-info output to stdout.
66- , H. ignoreOnWindows " kes-period-info" Cardano.Testnet.Test.Cli.KesPeriodInfo. hprop_kes_period_info
67- , H. ignoreOnWindows " query-slot-number" Cardano.Testnet.Test.Cli.QuerySlotNumber. hprop_querySlotNumber
68- , H. ignoreOnWindows " foldBlocks receives ledger state" Cardano.Testnet.Test.FoldBlocks. prop_foldBlocks
6978 ]
79+ ]
7080
71- ]
72- , sequentialTestGroup " SubmitApi"
73- [ sequentialTestGroup " Babbage"
74- [ H. ignoreOnWindows " transaction" Cardano.Testnet.Test.SubmitApi.Babbage.Transaction. hprop_transaction
75- ]
76- ]
77- ]
81+ shouldRunInParallel :: IO Bool
82+ shouldRunInParallel = (== Just " 1" ) <$> E. lookupEnv " PARALLEL_TESTNETS"
7883
7984-- FIXME Right now when running tests concurrently it makes them flaky
80- sequentialTestGroup :: T. TestName -> [TestTree ] -> TestTree
81- sequentialTestGroup name = T. sequentialTestGroup name T. AllFinish
85+ runTestGroup
86+ :: Bool -- ^ True to run in parallel
87+ -> T. TestName
88+ -> [TestTree ]
89+ -> TestTree
90+ runTestGroup True name = T. testGroup name
91+ runTestGroup False name = T. sequentialTestGroup name T. AllFinish
8292
8393ingredients :: [T. Ingredient ]
8494ingredients = T. defaultIngredients
0 commit comments