Skip to content

Commit

Permalink
create-testnet-data: test minimal example
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Jan 25, 2024
1 parent 43e73c9 commit f531f8d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ test-suite cardano-cli-test

other-modules: Test.Cli.AddCostModels
Test.Cli.CliIntermediateFormat
Test.Cli.CreateTestnetData
Test.Cli.FilePermissions
Test.Cli.Governance.Hash
Test.Cli.ITN
Expand Down
29 changes: 29 additions & 0 deletions cardano-cli/test/cardano-cli-test/Test/Cli/CreateTestnetData.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module Test.Cli.CreateTestnetData where



import System.FilePath

import Test.Cardano.CLI.Util (execCardanoCLI)

import Hedgehog (Property)
import Hedgehog.Extras (moduleWorkspace, propertyOnce)
import qualified Hedgehog.Extras as H

-- | Test case for https://github.com/IntersectMBO/cardano-cli/issues/587
-- Execute this test with:
-- @cabal test cardano-cli-test --test-options '-p "/create testnet data minimal/"'@
hprop_create_testnet_data_minimal :: Property
hprop_create_testnet_data_minimal =
propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do

let outputDir = tempDir </> "out"

H.noteM_ $ execCardanoCLI
["conway", "genesis", "create-testnet-data"
, "--testnet-magic", "42"
, "--out-dir", outputDir
]

-- We test that the command doesn't crash, because otherwise
-- execCardanoCLI would fail.

0 comments on commit f531f8d

Please sign in to comment.