Skip to content

Commit 8be52eb

Browse files
committed
tx-sub: restructure tasty test groups
* Make all `TxLogic` appear under `AppV2` group. * Renamed `AppV2.diffusion` test as `AppV2.txSubmission` similar to `AppV2.txSubmission` This makes it easier to run all tx-submission v2 tests.
1 parent f59436b commit 8be52eb

File tree

3 files changed

+45
-43
lines changed

3 files changed

+45
-43
lines changed

ouroboros-network/testlib/Test/Ouroboros/Network/TxSubmission.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Test.Tasty (TestTree, testGroup)
88

99
tests :: TestTree
1010
tests = testGroup "Ouroboros.Network.TxSubmission"
11-
[ TxLogic.tests
12-
, AppV1.tests
11+
[ AppV1.tests
12+
, TxLogic.tests
1313
, AppV2.tests
1414
]

ouroboros-network/testlib/Test/Ouroboros/Network/TxSubmission/AppV2.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import Test.Tasty.QuickCheck (testProperty)
7171

7272
tests :: TestTree
7373
tests = testGroup "AppV2"
74-
[ testProperty "diffusion" prop_txSubmission_diffusion
74+
[ testProperty "txSubmission" prop_txSubmission
7575
, testProperty "inflight" prop_txSubmission_inflight
7676
, testProperty "SharedTxState" $ withMaxSize 25
7777
$ withMaxSuccess 25
@@ -305,8 +305,8 @@ filterValidTxs
305305
-- property test are the same as for tx submission v1. We need this to know we
306306
-- didn't regress.
307307
--
308-
prop_txSubmission_diffusion :: TxSubmissionState -> Property
309-
prop_txSubmission_diffusion st@(TxSubmissionState peers _) =
308+
prop_txSubmission :: TxSubmissionState -> Property
309+
prop_txSubmission st@(TxSubmissionState peers _) =
310310
let tr = runSimTrace (txSubmissionSimulation st)
311311
numPeersWithWronglySizedTx :: Int
312312
numPeersWithWronglySizedTx =

ouroboros-network/testlib/Test/Ouroboros/Network/TxSubmission/TxLogic.hs

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -61,48 +61,50 @@ import Text.Pretty.Simple
6161

6262

6363
tests :: TestTree
64-
tests = testGroup "TxLogic"
65-
[ testGroup "State"
66-
[ testGroup "Arbitrary"
67-
[ testGroup "ArbSharedTxState"
68-
[ testProperty "generator" prop_SharedTxState_generator
69-
, testProperty "shrinker" $ withMaxSuccess 10
70-
prop_SharedTxState_shrinker
71-
, testProperty "nothunks" prop_SharedTxState_nothunks
64+
tests = testGroup "AppV2"
65+
[ testGroup "TxLogic"
66+
[ testGroup "State"
67+
[ testGroup "Arbitrary"
68+
[ testGroup "ArbSharedTxState"
69+
[ testProperty "generator" prop_SharedTxState_generator
70+
, testProperty "shrinker" $ withMaxSuccess 10
71+
prop_SharedTxState_shrinker
72+
, testProperty "nothunks" prop_SharedTxState_nothunks
73+
]
74+
, testGroup "ArbReceivedTxIds"
75+
[ testProperty "generator" prop_receivedTxIds_generator
76+
]
77+
, testGroup "ArbCollectTxs"
78+
[ testProperty "generator" prop_collectTxs_generator
79+
, testProperty "shrinker" $ withMaxSuccess 10
80+
prop_collectTxs_shrinker
81+
]
7282
]
73-
, testGroup "ArbReceivedTxIds"
74-
[ testProperty "generator" prop_receivedTxIds_generator
83+
, testProperty "acknowledgeTxIds" prop_acknowledgeTxIds
84+
, testProperty "receivedTxIdsImpl" prop_receivedTxIdsImpl
85+
, testProperty "collectTxsImpl" prop_collectTxsImpl
86+
, testProperty "splitAcknowledgedTxIds" prop_splitAcknowledgedTxIds
87+
, testGroup "NoThunks"
88+
[ testProperty "receivedTxIdsImpl" prop_receivedTxIdsImpl_nothunks
89+
, testProperty "collectTxsImpl" prop_collectTxsImpl_nothunks
7590
]
76-
, testGroup "ArbCollectTxs"
77-
[ testProperty "generator" prop_collectTxs_generator
78-
, testProperty "shrinker" $ withMaxSuccess 10
79-
prop_collectTxs_shrinker
80-
]
81-
]
82-
, testProperty "acknowledgeTxIds" prop_acknowledgeTxIds
83-
, testProperty "receivedTxIdsImpl" prop_receivedTxIdsImpl
84-
, testProperty "collectTxsImpl" prop_collectTxsImpl
85-
, testProperty "splitAcknowledgedTxIds" prop_splitAcknowledgedTxIds
86-
, testGroup "NoThunks"
87-
[ testProperty "receivedTxIdsImpl" prop_receivedTxIdsImpl_nothunks
88-
, testProperty "collectTxsImpl" prop_collectTxsImpl_nothunks
8991
]
90-
]
91-
, testGroup "Decisions"
92-
[ testGroup "ArbDecisionContexts"
93-
[ testProperty "generator" prop_ArbDecisionContexts_generator
94-
, testProperty "shrinker" $ withMaxSuccess 33
95-
prop_ArbDecisionContexts_shrinker
92+
, testGroup "Decisions"
93+
[ testGroup "ArbDecisionContexts"
94+
[ testProperty "generator" prop_ArbDecisionContexts_generator
95+
, testProperty "shrinker" $ withMaxSuccess 33
96+
prop_ArbDecisionContexts_shrinker
97+
]
98+
, testProperty "shared state invariant" prop_makeDecisions_sharedstate
99+
, testProperty "inflight" prop_makeDecisions_inflight
100+
, testProperty "policy" prop_makeDecisions_policy
101+
, testProperty "acknowledged" prop_makeDecisions_acknowledged
102+
, testProperty "exhaustive" prop_makeDecisions_exhaustive
96103
]
97-
, testProperty "shared state invariant" prop_makeDecisions_sharedstate
98-
, testProperty "inflight" prop_makeDecisions_inflight
99-
, testProperty "policy" prop_makeDecisions_policy
100-
, testProperty "acknowledged" prop_makeDecisions_acknowledged
101-
, testProperty "exhaustive" prop_makeDecisions_exhaustive
102-
]
103-
, testGroup "Registry"
104-
[ testGroup "filterActivePeers"
105-
[ testProperty "not limiting decisions" prop_filterActivePeers_not_limitting_decisions
104+
, testGroup "Registry"
105+
[ testGroup "filterActivePeers"
106+
[ testProperty "not limiting decisions" prop_filterActivePeers_not_limitting_decisions
107+
]
106108
]
107109
]
108110
]

0 commit comments

Comments
 (0)