Skip to content

Commit

Permalink
Merge #4595
Browse files Browse the repository at this point in the history
4595: Reorder module hierarchy r=Jimbo4350 a=MarcFontaine



Co-authored-by: MarcFontaine <[email protected]>
  • Loading branch information
iohk-bors[bot] and MarcFontaine authored Nov 3, 2022
2 parents 46d8db3 + 44aef75 commit 240e64a
Show file tree
Hide file tree
Showing 27 changed files with 117 additions and 262 deletions.
2 changes: 1 addition & 1 deletion cardano-node-chairman/test/Spec/Chairman/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import qualified Hedgehog as H
import qualified Hedgehog.Extras.Test.Base as H
import qualified Hedgehog.Extras.Test.Process as H
import qualified System.Directory as IO
import qualified Test.Base as H
import qualified Testnet.Byron as H
import qualified Testnet.Conf as H
import qualified Util.Base as H

{- HLINT ignore "Reduce duplication" -}
{- HLINT ignore "Redundant <&>" -}
Expand Down
4 changes: 2 additions & 2 deletions cardano-node-chairman/test/Spec/Chairman/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import qualified Hedgehog as H
import qualified Hedgehog.Extras.Test.Base as H
import qualified Hedgehog.Extras.Test.Process as H
import qualified System.Directory as IO
import qualified Test.Base as H
import qualified Test.Runtime as H
import qualified Testnet.Cardano as H
import qualified Testnet.Conf as H
import qualified Util.Base as H
import qualified Util.Runtime as H

{- HLINT ignore "Reduce duplication" -}
{- HLINT ignore "Redundant <&>" -}
Expand Down
2 changes: 1 addition & 1 deletion cardano-node-chairman/test/Spec/Chairman/Chairman.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import qualified Hedgehog.Extras.Test.Process as H
import qualified System.Environment as IO
import qualified System.IO as IO
import qualified System.Process as IO
import qualified Test.Process as H
import qualified Testnet.Conf as H
import qualified Util.Process as H

{- HLINT ignore "Reduce duplication" -}
{- HLINT ignore "Redundant <&>" -}
Expand Down
4 changes: 2 additions & 2 deletions cardano-node-chairman/test/Spec/Chairman/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import qualified Hedgehog as H
import qualified Hedgehog.Extras.Test.Base as H
import qualified Hedgehog.Extras.Test.Process as H
import qualified System.Directory as IO
import qualified Test.Base as H
import qualified Test.Runtime as H
import qualified Testnet.Conf as H
import qualified Testnet.Shelley as H
import qualified Util.Base as H
import qualified Util.Runtime as H

hprop_chairman :: H.Property
hprop_chairman = H.integration . H.runFinallies . H.workspace "chairman" $ \tempAbsPath' -> do
Expand Down
40 changes: 19 additions & 21 deletions cardano-testnet/cardano-testnet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ library

build-depends: aeson
, ansi-terminal
, base16-bytestring
, bytestring
, cardano-api
, cardano-cli
Expand All @@ -42,15 +41,16 @@ library
, filepath
, hedgehog
, hedgehog-extras
, http-client
, http-types
, optparse-applicative-fork
, ouroboros-network
, process
, random
, resourcet
, safe-exceptions
, stm
, tasty
, tasty-expected-failure
, tasty-hedgehog
, text
, time
, transformers
Expand All @@ -63,18 +63,18 @@ library
Parsers.Cardano
Parsers.Shelley
Parsers.Version
Test.Assert
Test.Base
Test.Process
Test.Runtime
Util.Assert
Util.Base
Util.Ignore
Util.Process
Util.Runtime
Testnet
Testnet.Babbage
Testnet.Byron
Testnet.Cardano
Testnet.Conf
Testnet.Run
Testnet.Shelley
Testnet.SubmitApi
Testnet.Utils

other-modules: Paths_cardano_testnet
Expand All @@ -100,33 +100,31 @@ test-suite cardano-testnet-tests

main-is: Main.hs

other-modules: Test.Cli.Alonzo.LeadershipSchedule
Test.Cli.Babbage.LeadershipSchedule
Test.Cli.KesPeriodInfo
Test.Misc
Test.Node.Shutdown
Test.ShutdownOnSlotSynced

type: exitcode-stdio-1.0

build-depends: cardano-testnet
, aeson >= 2.1.0.0
build-depends: aeson
, cardano-api
, cardano-cli
, cardano-testnet
, containers
, directory
, filepath
, hedgehog
, hedgehog
, hedgehog-extras
, process
, tasty
, tasty-expected-failure
, tasty-hedgehog
, text
, time


other-modules:
Spec.Cli.Alonzo.LeadershipSchedule
Spec.Cli.Babbage.LeadershipSchedule
Spec.Cli.KesPeriodInfo
Spec.Node.Shutdown
Spec.ShutdownOnSlotSynced
Testnet.Properties.Cli.KesPeriodInfo

Test.Util

ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T

Expand Down
14 changes: 4 additions & 10 deletions cardano-testnet/src/Parsers/Babbage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ module Parsers.Babbage
, runBabbageOptions
) where

import Data.Eq
import Data.Function
import Data.Int
import Data.Maybe
import Data.Semigroup
import Prelude
import Options.Applicative
import System.IO (IO)
import Test.Runtime (readNodeLoggingFormat)
import qualified Options.Applicative as OA

import Testnet
import Testnet.Babbage
import Testnet.Run (runTestnet)
import Text.Show

import qualified Options.Applicative as OA
import Util.Runtime (readNodeLoggingFormat)

data BabbageOptions = BabbageOptions
{ maybeTestnetMagic :: Maybe Int
Expand Down
18 changes: 6 additions & 12 deletions cardano-testnet/src/Parsers/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,17 @@ module Parsers.Cardano
, runCardanoOptions
) where

import Data.Eq
import Data.Function
import Data.Int
import Data.Maybe
import Data.Semigroup
import GHC.Enum
import Prelude
import qualified Data.List as L
import Options.Applicative
import System.IO (IO)
import Test.Runtime (readNodeLoggingFormat)
import qualified Options.Applicative as OA
import Text.Read

import Util.Runtime (readNodeLoggingFormat)
import Testnet
import Testnet.Cardano
import Testnet.Run (runTestnet)
import Text.Read
import Text.Show

import qualified Data.List as L
import qualified Options.Applicative as OA

data CardanoOptions = CardanoOptions
{ maybeTestnetMagic :: Maybe Int
Expand Down
13 changes: 7 additions & 6 deletions cardano-testnet/src/Testnet/Babbage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ import Data.Aeson (encode, object, toJSON, (.=))
import Hedgehog.Extras.Stock.Time (showUTCTimeSeconds)
import System.FilePath.Posix ((</>))

import Test.Runtime (Delegator (..), NodeLoggingFormat (..), PaymentKeyPair (..),
PoolNode (PoolNode), PoolNodeKeys (..), StakingKeyPair (..),
TestnetRuntime (..), startNode)

import qualified Data.HashMap.Lazy as HM
import qualified Data.List as L
import qualified Data.Time.Clock as DTC
Expand All @@ -37,10 +33,15 @@ import qualified Hedgehog.Extras.Stock.OS as OS
import qualified Hedgehog.Extras.Test.Base as H
import qualified Hedgehog.Extras.Test.File as H
import qualified System.Info as OS
import qualified Test.Assert as H

import qualified Util.Assert as H
import Util.Process (execCli_)
import Util.Runtime (Delegator (..), NodeLoggingFormat (..), PaymentKeyPair (..),
PoolNode (PoolNode), PoolNodeKeys (..), StakingKeyPair (..),
TestnetRuntime (..), startNode)
import qualified Testnet.Conf as H

import Test.Process (execCli_)


{- HLINT ignore "Redundant flip" -}

Expand Down
2 changes: 1 addition & 1 deletion cardano-testnet/src/Testnet/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ import qualified Hedgehog.Extras.Test.Process as H
import qualified System.Info as OS
import qualified System.IO as IO
import qualified System.Process as IO
import qualified Test.Process as H
import qualified Testnet.Conf as H
import qualified Util.Process as H

{- HLINT ignore "Reduce duplication" -}
{- HLINT ignore "Redundant <&>" -}
Expand Down
12 changes: 6 additions & 6 deletions cardano-testnet/src/Testnet/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ import Hedgehog.Extras.Stock.Time (formatIso8601, showUTCTimeSeconds)
import Ouroboros.Network.PeerSelection.LedgerPeers (UseLedgerAfter (..))
import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..))
import System.FilePath.Posix ((</>))
import Test.Runtime as TR (NodeLoggingFormat (..), PaymentKeyPair (..), PoolNode (PoolNode),
PoolNodeKeys (..), TestnetRuntime (..), startNode)

import Test.Process (execCli_)

import qualified Cardano.Node.Configuration.Topology as NonP2P
import qualified Cardano.Node.Configuration.TopologyP2P as P2P
Expand All @@ -53,8 +49,12 @@ import qualified Hedgehog.Extras.Test.File as H
import qualified Hedgehog.Extras.Test.Network as H
import qualified System.Directory as IO
import qualified System.Info as OS
import qualified Test.Assert as H
import qualified Test.Process as H
import qualified Util.Assert as H
import qualified Util.Process as H
import Util.Process (execCli_)
import Util.Runtime as TR (NodeLoggingFormat (..), PaymentKeyPair (..), PoolNode (PoolNode),
PoolNodeKeys (..), TestnetRuntime (..), startNode)

import qualified Testnet.Conf as H

{- HLINT ignore "Redundant flip" -}
Expand Down
13 changes: 0 additions & 13 deletions cardano-testnet/src/Testnet/Conf.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ module Testnet.Conf
, YamlFilePath(..)
, Conf(..)
, mkConf

, SubmitApiConfig(..)
) where

import Control.Monad
import Data.Eq
import Data.Function
import Data.Int
import Data.Maybe
import Hedgehog.Extras.Stock.IO.Network.Sprocket (Sprocket (..))
import System.FilePath.Posix ((</>))
import System.IO (FilePath)
import Text.Show
Expand Down Expand Up @@ -52,13 +49,3 @@ mkConf (ProjectBase base) (YamlFilePath configurationTemplate) tempAbsPath maybe
logDir <- H.noteTempFile tempAbsPath "logs"

return $ Conf {..}

data SubmitApiConfig = SubmitApiConfig
{ tempBaseAbsPath :: FilePath
, base :: FilePath
, configFile :: FilePath
, sprocket :: Sprocket
, testnetMagic :: Int
, stdoutFile :: FilePath
, stderrFile :: FilePath
} deriving (Eq, Show)
2 changes: 1 addition & 1 deletion cardano-testnet/src/Testnet/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import qualified System.Console.ANSI as ANSI
import qualified System.Directory as IO
import qualified System.Exit as IO
import qualified System.IO as IO
import qualified Test.Base as H
import qualified Testnet.Conf as H
import qualified Util.Base as H

testnetProperty :: Maybe Int -> (H.Conf -> H.Integration ()) -> H.Property
testnetProperty maybeTestnetMagic tn = H.integration . H.runFinallies . H.workspace "chairman" $ \tempAbsPath' -> do
Expand Down
9 changes: 5 additions & 4 deletions cardano-testnet/src/Testnet/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import Hedgehog.Extras.Stock.IO.Network.Sprocket (Sprocket(..))
import Ouroboros.Network.PeerSelection.LedgerPeers (UseLedgerAfter(..))
import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint(..))
import System.FilePath.Posix ((</>))
import Test.Process (execCli_)
import Test.Runtime hiding (allNodes)

import qualified Cardano.Node.Configuration.Topology as NonP2P
import qualified Cardano.Node.Configuration.TopologyP2P as P2P
Expand All @@ -52,9 +50,12 @@ import qualified Hedgehog.Extras.Test.Network as H
import qualified Hedgehog.Extras.Test.Process as H
import qualified System.Directory as IO
import qualified System.Info as OS
import qualified Test.Base as H
import qualified Test.Process as H
import qualified Testnet.Conf as H
import qualified Util.Base as H
import qualified Util.Process as H
import Util.Process (execCli_)
import Util.Runtime hiding (allNodes)


{- HLINT ignore "Redundant <&>" -}
{- HLINT ignore "Redundant flip" -}
Expand Down
Loading

0 comments on commit 240e64a

Please sign in to comment.