Skip to content

Commit

Permalink
Merge #1519
Browse files Browse the repository at this point in the history
1519: Reorganise ouroboros-network modules r=coot a=coot

* add `ouroboros-protocol-tests` library. It includes all the Example
  and Test modules which were under `Ouroboros.Network.Protocols`, with
  one exception: `Ouroboros.Network.Protocols.ChainSync.Example` which is
  required for `test-conesnsus`.  We might be able to fix this in future
  by makeing ouroboros-protocol-test library public.
* `test-network` library depends on the internal
  `ouroboros-protocol-tests` library.

Co-authored-by: Marcin Szamotulski <[email protected]>
  • Loading branch information
iohk-bors[bot] and coot authored Jan 28, 2020
2 parents 8ec091c + ceee1e5 commit 65085e3
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 136 deletions.
29 changes: 28 additions & 1 deletion nix/.stack.nix/ouroboros-network.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nix/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let
packages.network-mux.configureFlags = [ "--ghc-option=-Werror" ];
packages.ouroboros-network.configureFlags = [ "--ghc-option=-Werror" ];
packages.ouroboros-network.flags.cddl = true;
packages.ouroboros-network.components.tests.cddl.build-tools = [pkgs.cddl pkgs.cbor-diag];
packages.ouroboros-network.components.tests.test-cddl.build-tools = [pkgs.cddl pkgs.cbor-diag];
packages.ouroboros-consensus.configureFlags = [ "--ghc-option=-Werror" ];
packages.prometheus.components.library.doExactConfig = true;
packages.libiserv.patches = [ ./libiserv-network-3.patch ];
Expand Down
182 changes: 49 additions & 133 deletions ouroboros-network/ouroboros-network.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ library
Ouroboros.Network.Protocol.ChainSync.Codec
Ouroboros.Network.Protocol.ChainSync.Server
Ouroboros.Network.Protocol.ChainSync.Type
Ouroboros.Network.Protocol.ChainSync.Examples
Ouroboros.Network.Protocol.ChainSync.ExamplesPipelined
Ouroboros.Network.Protocol.ChainSync.PipelineDecision
-- ChainSync.Examples module is needed by test-consensus
Ouroboros.Network.Protocol.ChainSync.Examples
Ouroboros.Network.Protocol.BlockFetch.Type
Ouroboros.Network.Protocol.BlockFetch.Client
Ouroboros.Network.Protocol.BlockFetch.Server
Expand Down Expand Up @@ -170,94 +170,58 @@ library
build-depends: hashable >=1.2 && <1.3,
text >=1.2 && <1.3

test-suite test-network
type: exitcode-stdio-1.0
hs-source-dirs: test src
main-is: Main.hs
other-modules: Codec.SerialiseTerm
Ouroboros.Network.AnchoredFragment
Ouroboros.Network.Testing.ConcreteBlock
Ouroboros.Network.Block
Ouroboros.Network.BlockFetch
Ouroboros.Network.BlockFetch.Client
Ouroboros.Network.BlockFetch.ClientRegistry
Ouroboros.Network.BlockFetch.ClientState
Ouroboros.Network.BlockFetch.Decision
Ouroboros.Network.BlockFetch.DeltaQ
Ouroboros.Network.BlockFetch.Examples
Ouroboros.Network.BlockFetch.State
Ouroboros.Network.ChainFragment
Ouroboros.Network.MockChain.Chain
Ouroboros.Network.MockChain.ProducerState
Ouroboros.Network.Channel
Ouroboros.Network.DeltaQ
Ouroboros.Network.Magic
Ouroboros.Network.ErrorPolicy
Ouroboros.Network.Mux
Ouroboros.Network.Tracers
Ouroboros.Network.MockNode
Ouroboros.Network.NodeToNode
Ouroboros.Network.Point
Ouroboros.Network.PeerSelection.Types
Ouroboros.Network.PeerSelection.KnownPeers
Ouroboros.Network.PeerSelection.RootPeersDNS
Ouroboros.Network.PeerSelection.JobPool
Ouroboros.Network.PeerSelection.Governor
Ouroboros.Network.PeerSelection.Test
Ouroboros.Network.Protocol.BlockFetch.Client
Ouroboros.Network.Protocol.BlockFetch.Codec
Ouroboros.Network.Protocol.BlockFetch.Direct
library ouroboros-protocol-tests
hs-source-dirs: protocol-tests
default-language: Haskell2010
exposed-modules: Ouroboros.Network.Protocol.BlockFetch.Direct
Ouroboros.Network.Protocol.BlockFetch.Examples
Ouroboros.Network.Protocol.BlockFetch.Server
Ouroboros.Network.Protocol.BlockFetch.Type
Ouroboros.Network.Protocol.BlockFetch.Test
Ouroboros.Network.Protocol.ChainSync.Client
Ouroboros.Network.Protocol.ChainSync.ClientPipelined
Ouroboros.Network.Protocol.ChainSync.Codec
Ouroboros.Network.Protocol.ChainSync.Direct
Ouroboros.Network.Protocol.ChainSync.DirectPipelined
Ouroboros.Network.Protocol.ChainSync.Examples
Ouroboros.Network.Protocol.ChainSync.ExamplesPipelined
Ouroboros.Network.Protocol.ChainSync.PipelineDecision
Ouroboros.Network.Protocol.ChainSync.Server
Ouroboros.Network.Protocol.ChainSync.Type
Ouroboros.Network.Protocol.ChainSync.Test
Ouroboros.Network.Protocol.Handshake.Type
Ouroboros.Network.Protocol.Handshake.Codec
Ouroboros.Network.Protocol.Handshake.Test
Ouroboros.Network.Protocol.Handshake.Version
Ouroboros.Network.Protocol.TxSubmission.Client
Ouroboros.Network.Protocol.TxSubmission.Codec
Ouroboros.Network.Protocol.TxSubmission.Direct
Ouroboros.Network.Protocol.TxSubmission.Examples
Ouroboros.Network.Protocol.TxSubmission.Server
Ouroboros.Network.Protocol.TxSubmission.Type
Ouroboros.Network.Protocol.TxSubmission.Test
Ouroboros.Network.Protocol.LocalTxSubmission.Client
Ouroboros.Network.Protocol.LocalTxSubmission.Codec
Ouroboros.Network.Protocol.LocalTxSubmission.Direct
Ouroboros.Network.Protocol.LocalTxSubmission.Examples
Ouroboros.Network.Protocol.LocalTxSubmission.Server
Ouroboros.Network.Protocol.LocalTxSubmission.Type
Ouroboros.Network.Protocol.LocalTxSubmission.Test
Ouroboros.Network.Socket
Ouroboros.Network.Server.ConnectionTable
Ouroboros.Network.Server.Socket
Ouroboros.Network.Subscription
Ouroboros.Network.Subscription.Ip
Ouroboros.Network.Subscription.Dns
Ouroboros.Network.Subscription.PeerState
Ouroboros.Network.Subscription.Subscriber
Ouroboros.Network.Subscription.Worker
Ouroboros.Network.TxSubmission.Inbound
Ouroboros.Network.TxSubmission.Outbound
Ouroboros.Network.Protocol.TxSubmission.Direct
Ouroboros.Network.Protocol.TxSubmission.Examples
Ouroboros.Network.Protocol.TxSubmission.Test

Test.AnchoredFragment
Test.Chain
Test.ChainGenerators
Test.ChainFragment
Test.ChainProducerState
Test.Ouroboros.Network.Testing.Utils
build-depends: base,
bytestring,
cborg,
containers,
pipes,
QuickCheck,
serialise,
tasty,
tasty-quickcheck,
text,

cardano-prelude,

contra-tracer,
io-sim,
io-sim-classes,
typed-protocols,
typed-protocols-cbor,
ouroboros-network

test-suite test-network
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Main.hs
other-modules: Ouroboros.Network.BlockFetch.Examples
Ouroboros.Network.MockNode
Ouroboros.Network.PeerSelection.Test

Test.AnchoredFragment
Test.Chain
Test.ChainFragment
Test.Ouroboros.Network.BlockFetch
Test.Ouroboros.Network.MockNode
Test.Mux
Expand Down Expand Up @@ -301,7 +265,9 @@ test-suite test-network
text,
time,
typed-protocols-cbor,
typed-protocols
typed-protocols,
ouroboros-network,
ouroboros-protocol-tests

ghc-options: -Wall
-Wno-unticked-promoted-constructors
Expand All @@ -310,64 +276,12 @@ test-suite test-network
if flag(ipv6)
cpp-options: -DOUROBOROS_NETWORK_IPV6

test-suite cddl
test-suite test-cddl
type: exitcode-stdio-1.0
hs-source-dirs: test src
main-is: CDDL.hs
hs-source-dirs: test-cddl
main-is: Main.hs
if !flag(cddl)
buildable: False
other-modules: Codec.SerialiseTerm
Ouroboros.Network.AnchoredFragment
Ouroboros.Network.Block
Ouroboros.Network.MockChain.Chain
Ouroboros.Network.MockChain.ProducerState
Ouroboros.Network.ChainFragment
Ouroboros.Network.Channel
Ouroboros.Network.Point

Ouroboros.Network.Protocol.BlockFetch.Client
Ouroboros.Network.Protocol.BlockFetch.Codec
Ouroboros.Network.Protocol.BlockFetch.Direct
Ouroboros.Network.Protocol.BlockFetch.Examples
Ouroboros.Network.Protocol.BlockFetch.Server
Ouroboros.Network.Protocol.BlockFetch.Test
Ouroboros.Network.Protocol.BlockFetch.Type
Ouroboros.Network.Protocol.ChainSync.Client
Ouroboros.Network.Protocol.ChainSync.ClientPipelined
Ouroboros.Network.Protocol.ChainSync.Codec
Ouroboros.Network.Protocol.ChainSync.Direct
Ouroboros.Network.Protocol.ChainSync.DirectPipelined
Ouroboros.Network.Protocol.ChainSync.Examples
Ouroboros.Network.Protocol.ChainSync.ExamplesPipelined
Ouroboros.Network.Protocol.ChainSync.PipelineDecision
Ouroboros.Network.Protocol.ChainSync.Server
Ouroboros.Network.Protocol.ChainSync.Test
Ouroboros.Network.Protocol.ChainSync.Type
Ouroboros.Network.Protocol.Handshake.Codec
Ouroboros.Network.Protocol.Handshake.Type
Ouroboros.Network.Protocol.Handshake.Test
Ouroboros.Network.Protocol.Handshake.Version
Ouroboros.Network.Protocol.TxSubmission.Client
Ouroboros.Network.Protocol.TxSubmission.Codec
Ouroboros.Network.Protocol.TxSubmission.Direct
Ouroboros.Network.Protocol.TxSubmission.Examples
Ouroboros.Network.Protocol.TxSubmission.Server
Ouroboros.Network.Protocol.TxSubmission.Test
Ouroboros.Network.Protocol.TxSubmission.Type
Ouroboros.Network.Protocol.LocalTxSubmission.Codec
Ouroboros.Network.Protocol.LocalTxSubmission.Type
Ouroboros.Network.Protocol.LocalTxSubmission.Test
Ouroboros.Network.Protocol.LocalTxSubmission.Client
Ouroboros.Network.Protocol.LocalTxSubmission.Direct
Ouroboros.Network.Protocol.LocalTxSubmission.Examples
Ouroboros.Network.Protocol.LocalTxSubmission.Server

Ouroboros.Network.Testing.ConcreteBlock

Test.ChainGenerators
Test.ChainProducerState
Test.Ouroboros.Network.Testing.Utils

default-language: Haskell2010
build-depends: base,
bytestring,
Expand All @@ -390,7 +304,9 @@ test-suite cddl
tasty-quickcheck,
text,
typed-protocols-cbor,
typed-protocols
typed-protocols,
ouroboros-network,
ouroboros-protocol-tests
ghc-options: -Wall
-Wno-unticked-promoted-constructors
-fno-ignore-asserts
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ in commonLib.nix-tools.release-nix {
# FIXME: some jobs currently don't build:
disabled-jobs = [
# "Please use win32/Makefile.gcc instead.":
"nix-tools.tests.x86_64-pc-mingw32-ouroboros-network.cddl.x86_64-linux"
"nix-tools.tests.x86_64-pc-mingw32-ouroboros-network.test-cddl.x86_64-linux"
# hangs at Socket tests:
"nix-tools.tests.x86_64-pc-mingw32-ouroboros-network.test-network.x86_64-linux"
# 'Network.Socket.bind: permission denied (Operation not permitted)' at Socket tests:
Expand Down

0 comments on commit 65085e3

Please sign in to comment.