Skip to content

Commit

Permalink
ouroboros-network-framework: renamed modules in testlib
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Dec 19, 2024
1 parent 37326ec commit eb7d95c
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 48 deletions.
7 changes: 7 additions & 0 deletions ouroboros-network-framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
affects its API.
* Added `connStateSupply` record field to
`Ouroboros.Network.ConnectionManager.Core.Arguments`.
* Renamed modules in `ouroboros-network:testlib`:
`Ouroboros.Network.Test.Orphans -> Test.Ouroboros.Network.Orphans`
`Ouroboros.Network.ConnectionManager.Test.Experiments -> Test.Ouroboros.Network.ConnectionManager.Experiments`
`Ouroboros.Network.ConnectionManager.Test.Timeouts -> Test.Ouroboros.Network.ConnectionManager.Timeouts`
`Ouroboros.Network.ConnectionManager.Test.Utils -> Test.Ouroboros.Network.ConnectionManager.Utils`
`Ouroboros.Network.InboundGovernor.Test.Utils -> Test.Ouroboros.Network.InboundGovernor.Utils`


### Non-breaking changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import Control.Monad.Class.MonadTimer.SI
import Control.Monad.IOSim
import Control.Tracer

import Ouroboros.Network.Test.Orphans ()
import Test.Ouroboros.Network.Orphans ()

import Test.QuickCheck
import Test.Tasty (TestTree, testGroup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module Test.Ouroboros.Network.RawBearer where

import Ouroboros.Network.IOManager
import Ouroboros.Network.RawBearer
import Ouroboros.Network.RawBearer.Test.Utils
import Ouroboros.Network.Snocket
import Test.Ouroboros.Network.RawBearer.Utils

import Control.Concurrent.Class.MonadMVar
import Control.Monad.Class.MonadThrow (catchJust, finally)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import Ouroboros.Network.IOManager
import Ouroboros.Network.Snocket (socketSnocket)
import Ouroboros.Network.Socket (configureSocket)

import Ouroboros.Network.ConnectionManager.Test.Experiments
import Ouroboros.Network.ConnectionManager.Test.Timeouts
import Ouroboros.Network.Test.Orphans ()
import Test.Ouroboros.Network.ConnectionManager.Experiments
import Test.Ouroboros.Network.ConnectionManager.Timeouts
import Test.Ouroboros.Network.Orphans ()

tests :: TestTree
tests =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import Ouroboros.Network.Protocol.Handshake.Codec
import Ouroboros.Network.Protocol.Handshake.Unversioned
import Ouroboros.Network.Protocol.Handshake.Version

import Ouroboros.Network.Test.Orphans ()
import Test.Ouroboros.Network.Orphans ()

import Test.QuickCheck
import Test.Tasty (DependencyType (..), TestTree, after, testGroup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import Ouroboros.Network.Subscription.Subscriber
import Ouroboros.Network.Subscription.Worker (LocalAddresses (..),
WorkerParams (..))

import Ouroboros.Network.Test.Orphans ()
import Test.Ouroboros.Network.Orphans ()

import Test.QuickCheck
import Test.Tasty (TestTree, testGroup)
Expand Down
12 changes: 6 additions & 6 deletions ouroboros-network-framework/ouroboros-network-framework.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ library testlib
visibility: public
hs-source-dirs: testlib
exposed-modules:
Ouroboros.Network.ConnectionManager.Test.Experiments
Ouroboros.Network.ConnectionManager.Test.Timeouts
Ouroboros.Network.ConnectionManager.Test.Utils
Ouroboros.Network.InboundGovernor.Test.Utils
Ouroboros.Network.RawBearer.Test.Utils
Ouroboros.Network.Test.Orphans
Test.Ouroboros.Network.ConnectionManager.Experiments
Test.Ouroboros.Network.ConnectionManager.Timeouts
Test.Ouroboros.Network.ConnectionManager.Utils
Test.Ouroboros.Network.InboundGovernor.Utils
Test.Ouroboros.Network.Orphans
Test.Ouroboros.Network.RawBearer.Utils

other-modules:
build-depends:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ import Test.Tasty.QuickCheck (testProperty)
import Ouroboros.Network.ConnectionId (ConnectionId (..))
import Ouroboros.Network.ConnectionManager.Core qualified as CM
import Ouroboros.Network.ConnectionManager.State qualified as CM
import Ouroboros.Network.ConnectionManager.Test.Utils (verifyAbstractTransition)
import Ouroboros.Network.ConnectionManager.Types
import Ouroboros.Network.MuxMode
import Ouroboros.Network.NodeToNode.Version (DiffusionMode (..))
import Ouroboros.Network.Server.RateLimiting
import Ouroboros.Network.Snocket (Accept (..), Accepted (..),
AddressFamily (TestFamily), Snocket (..), TestAddress (..))

import Test.Ouroboros.Network.ConnectionManager.Utils (verifyAbstractTransition)

import Ouroboros.Network.ConnectionManager.InformationChannel
(newInformationChannel)
import Ouroboros.Network.ConnectionManager.InformationChannel qualified as InfoChannel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,18 @@ import Ouroboros.Network.Testing.Data.AbsBearerInfo hiding (delay)
import Ouroboros.Network.Testing.Utils (WithName (..), WithTime (..),
genDelayWithPrecision, nightlyTest, sayTracer, tracerWithTime)

import Ouroboros.Network.Test.Orphans ()
import Test.Simulation.Network.Snocket hiding (tests)

import Ouroboros.Network.ConnectionManager.Test.Experiments
import Ouroboros.Network.ConnectionManager.Test.Timeouts
import Ouroboros.Network.ConnectionManager.Test.Utils
import Test.Ouroboros.Network.ConnectionManager.Experiments
import Test.Ouroboros.Network.ConnectionManager.Timeouts
import Test.Ouroboros.Network.ConnectionManager.Utils
(abstractStateIsFinalTransition, allValidTransitionsNames,
validTransitionMap, verifyAbstractTransition,
verifyAbstractTransitionOrder)
import Ouroboros.Network.InboundGovernor.Test.Utils
import Test.Ouroboros.Network.InboundGovernor.Utils
(allValidRemoteTransitionsNames, remoteStrIsFinalTransition,
validRemoteTransitionMap, verifyRemoteTransition,
verifyRemoteTransitionOrder)
import Test.Ouroboros.Network.Orphans ()
import Test.Simulation.Network.Snocket hiding (tests)

tests :: TestTree
tests =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import Ouroboros.Network.Protocol.Handshake.Codec
import Ouroboros.Network.Protocol.Handshake.Unversioned
import Ouroboros.Network.Protocol.Handshake.Version

import Ouroboros.Network.Test.Orphans ()
import Test.Ouroboros.Network.Orphans ()

import Test.QuickCheck
import Test.Tasty (DependencyType (..), TestTree, after, testGroup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import Ouroboros.Network.Subscription.Subscriber
import Ouroboros.Network.Subscription.Worker (LocalAddresses (..),
WorkerParams (..))

import Ouroboros.Network.Test.Orphans ()
import Test.Ouroboros.Network.Orphans ()

import Test.QuickCheck
import Test.Tasty (TestTree, testGroup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ import Network.TypedProtocol.ReqResp.Client
import Network.TypedProtocol.ReqResp.Server
import Network.TypedProtocol.ReqResp.Type

import Ouroboros.Network.Test.Orphans ()
import Ouroboros.Network.Testing.Data.AbsBearerInfo
import Test.Ouroboros.Network.Orphans ()

import Test.QuickCheck hiding (Result (..))
import Test.QuickCheck.Instances.ByteString ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-- | This module contains experiments which can be executed either in `IO` or
-- in `IOSim`.
--
module Ouroboros.Network.ConnectionManager.Test.Experiments
module Test.Ouroboros.Network.ConnectionManager.Experiments
( ClientAndServerData (..)
, unidirectionalExperiment
, bidirectionalExperiment
Expand Down Expand Up @@ -99,12 +99,11 @@ import Ouroboros.Network.Snocket (Snocket)
import Ouroboros.Network.Snocket qualified as Snocket
import Ouroboros.Network.Testing.Utils (WithName (..))

import Ouroboros.Network.Test.Orphans ()
-- import Test.Simulation.Network.Snocket hiding (tests)
import Test.Ouroboros.Network.ConnectionManager.Timeouts
import Test.Ouroboros.Network.Orphans ()

import Ouroboros.Network.ConnectionManager.InformationChannel
(newInformationChannel)
import Ouroboros.Network.ConnectionManager.Test.Timeouts


--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}

module Ouroboros.Network.ConnectionManager.Test.Timeouts
module Test.Ouroboros.Network.ConnectionManager.Timeouts
( verifyAllTimeouts
, SimAddr
, SimAddr_
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Ouroboros.Network.ConnectionManager.Test.Utils where
module Test.Ouroboros.Network.ConnectionManager.Utils where

import Prelude hiding (read)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
module Ouroboros.Network.InboundGovernor.Test.Utils where

module Test.Ouroboros.Network.InboundGovernor.Utils where

import Test.QuickCheck
import Test.QuickCheck.Monoids
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# OPTIONS_GHC -Wno-orphans #-}
module Ouroboros.Network.Test.Orphans () where
module Test.Ouroboros.Network.Orphans () where

import Network.TypedProtocol.PingPong.Type (PingPong)
import Network.TypedProtocol.ReqResp.Type (ReqResp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Ouroboros.Network.RawBearer.Test.Utils where
module Test.Ouroboros.Network.RawBearer.Utils where

import Ouroboros.Network.RawBearer
import Ouroboros.Network.Snocket
Expand Down
21 changes: 6 additions & 15 deletions ouroboros-network/sim-tests-lib/Test/Ouroboros/Network/Testnet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,18 @@ import Network.DNS.Types qualified as DNS

import Ouroboros.Network.BlockFetch (PraosFetchMode (..),
TraceFetchClientState (..))
import Ouroboros.Network.ConsensusMode
import Ouroboros.Network.ConnectionHandler (ConnectionHandlerTrace (..))
import Ouroboros.Network.ConnectionId
import Ouroboros.Network.ConnectionManager.Core qualified as CM
import Ouroboros.Network.ConnectionManager.State qualified as CM
import Ouroboros.Network.ConnectionManager.Test.Timeouts (TestProperty (..),
classifyActivityType, classifyEffectiveDataFlow,
classifyNegotiatedDataFlow, classifyPrunings, classifyTermination,
groupConns, mkProperty, ppTransition, verifyAllTimeouts)
import Ouroboros.Network.ConnectionManager.Test.Utils
(abstractStateIsFinalTransition,
abstractStateIsFinalTransitionTVarTracing, connectionManagerTraceMap,
validTransitionMap, verifyAbstractTransition,
verifyAbstractTransitionOrder)
import Ouroboros.Network.ConnectionManager.Types
import Ouroboros.Network.ConsensusMode
import Ouroboros.Network.ExitPolicy (RepromoteDelay (..))
import Ouroboros.Network.InboundGovernor qualified as IG
import Ouroboros.Network.InboundGovernor.Test.Utils (inboundGovernorTraceMap,
remoteStrIsFinalTransition, serverTraceMap, validRemoteTransitionMap,
verifyRemoteTransition, verifyRemoteTransitionOrder)
import Ouroboros.Network.Mock.ConcreteBlock (BlockHeader)
import Ouroboros.Network.NodeToNode (DiffusionMode (..))
import Ouroboros.Network.PeerSelection.Bootstrap (UseBootstrapPeers (..),
requiresBootstrapPeers)
import Ouroboros.Network.InboundGovernor qualified as IG
import Ouroboros.Network.PeerSelection.Governor hiding (PeerSelectionState (..))
import Ouroboros.Network.PeerSelection.Governor qualified as Governor
import Ouroboros.Network.PeerSelection.LedgerPeers
Expand Down Expand Up @@ -99,14 +87,17 @@ import Ouroboros.Network.Testing.Utils hiding (SmallDelay, debugTracer)

import Simulation.Network.Snocket (BearerInfo (..))

import Test.Ouroboros.Network.ConnectionManager.Timeouts
import Test.Ouroboros.Network.ConnectionManager.Utils
import Test.Ouroboros.Network.InboundGovernor.Utils
import Test.Ouroboros.Network.LedgerPeers (LedgerPools (..))
import Test.Ouroboros.Network.Testnet.Internal
import Test.Ouroboros.Network.Testnet.Node (config_REPROMOTE_DELAY)
import Test.Ouroboros.Network.Testnet.Node.Kernel
import Test.QuickCheck
import Test.QuickCheck.Monoids
import Test.Tasty
import Test.Tasty.QuickCheck (testProperty)
import Test.Tasty.QuickCheck

tests :: TestTree
tests =
Expand Down

0 comments on commit eb7d95c

Please sign in to comment.