Skip to content

Commit

Permalink
Revert "Create workspace only once"
Browse files Browse the repository at this point in the history
This reverts commit 11f2fb6.
  • Loading branch information
carbolymer committed Feb 9, 2024
1 parent 11f2fb6 commit d68dae3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions cardano-cli/test/cardano-cli-test/Test/Cli/CreateTestnetData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Control.Monad.IO.Class
import Data.Aeson (FromJSON, ToJSON)
import qualified Data.Aeson as A
import qualified Data.ByteString.Lazy as LBS
import Data.IORef (atomicModifyIORef, newIORef)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M
import Data.Text (Text)
Expand Down Expand Up @@ -44,10 +43,8 @@ hprop_create_testnet_data_minimal =
]
success

-- Execute this test with:
-- @cabal test cardano-cli-test --test-options '-p "/create testnet data create nonegative supply/"'@
hprop_create_testnet_data_create_nonegative_supply :: Property
hprop_create_testnet_data_create_nonegative_supply = H.property $ do
hprop_create_testnet_data_create_nonegative_supply = do
-- FIXME rewrite this as a property test
let supplyValues =
[ -- (total supply, delegated supply)
Expand All @@ -56,12 +53,9 @@ hprop_create_testnet_data_create_nonegative_supply = H.property $ do
, (1_000_000_000, 2_000_000_000)
] :: [(Int, Int)]

ref <- liftIO $ newIORef (0 :: Int)

moduleWorkspace "tmp" $ \tempDir -> do
forM_ supplyValues $ \(totalSupply, delegatedSupply) -> do
suffix <- liftIO $ atomicModifyIORef ref (\x -> (x + 1, x))
let outputDir = tempDir </> "out" <> show suffix
propertyOnce $ forM_ supplyValues $ \(totalSupply, delegatedSupply) ->
moduleWorkspace "tmp" $ \tempDir -> do
let outputDir = tempDir </> "out"

H.noteM_ $ execCardanoCLI
["conway", "genesis", "create-testnet-data"
Expand Down

0 comments on commit d68dae3

Please sign in to comment.