Skip to content

Commit

Permalink
Enable running testnet tests using all threads
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed May 3, 2024
1 parent 285268c commit 03b946f
Showing 1 changed file with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,12 @@ import qualified Cardano.Testnet.Test.SubmitApi.Babbage.Transaction
import Prelude

import qualified System.Environment as E
import qualified System.Exit as IO
import qualified System.IO as IO
import System.IO (BufferMode (LineBuffering), hSetBuffering, hSetEncoding, stdout, utf8)

import qualified Testnet.Property.Run as H

import qualified Test.Tasty as T
import Test.Tasty (TestTree)
import qualified Test.Tasty.Ingredients as T
import qualified Test.Tasty.Options as T
import qualified Test.Tasty.Runners as T

tests :: IO TestTree
tests = do
Expand Down Expand Up @@ -91,21 +86,6 @@ tests = do
]
]

defaultMainWithIngredientsAndOptions :: [T.Ingredient] -> T.OptionSet -> T.TestTree -> IO ()
defaultMainWithIngredientsAndOptions ins opts testTree = do
T.installSignalHandlers
parsedOpts <- T.parseOptions ins testTree
let opts' = opts <> parsedOpts

case T.tryIngredients ins opts' testTree of
Nothing -> do
IO.hPutStrLn IO.stderr
"No ingredients agreed to run. Something is wrong either with your ingredient set or the options."
IO.exitFailure
Just act -> do
ok <- act
if ok then IO.exitSuccess else IO.exitFailure

main :: IO ()
main = do
Crypto.cryptoInit
Expand All @@ -114,6 +94,4 @@ main = do
hSetEncoding stdout utf8
args <- E.getArgs

let opts = T.singleOption $ T.NumThreads 1

E.withArgs args $ tests >>= defaultMainWithIngredientsAndOptions T.defaultIngredients opts
E.withArgs args $ tests >>= T.defaultMainWithIngredients T.defaultIngredients

0 comments on commit 03b946f

Please sign in to comment.