Skip to content

Commit

Permalink
Merge pull request #459 from haskell-distributed/remove-rematch-depen…
Browse files Browse the repository at this point in the history
…dency

Remove rematch dependency
  • Loading branch information
LaurentRDC authored Oct 30, 2024
2 parents 0f8db66 + 4f46d96 commit 5ff75cd
Show file tree
Hide file tree
Showing 27 changed files with 132 additions and 197 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
run: |
cabal configure --enable-tests --test-show-details=direct
cabal freeze --minimize-conflict-set
cat cabal.project.freeze
- name: Cache cabal work
uses: actions/cache@v4
Expand Down
4 changes: 4 additions & 0 deletions packages/distributed-process-async/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-10-30 Laurent P. René de Cotret <[email protected]> 0.2.9

* Removed dependency on `rematch` (#459)

2024-09-03 Laurent P. René de Cotret <[email protected]> 0.2.8

* Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: distributed-process-async
version: 0.2.8
version: 0.2.9
build-type: Simple
license: BSD-3-Clause
license-file: LICENCE
Expand Down Expand Up @@ -68,7 +68,7 @@ test-suite AsyncTests
ansi-terminal >= 0.5 && < 0.9,
distributed-process,
distributed-process-async,
distributed-process-systest >= 0.2.0,
distributed-process-systest ^>= 0.4,
exceptions >= 0.10 && < 1.0,
network >= 2.5 && < 3.3,
network-transport >= 0.4 && < 0.6,
Expand All @@ -79,7 +79,6 @@ test-suite AsyncTests
stm >= 2.3 && < 2.6,
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
rematch >= 0.2.0.0,
transformers
hs-source-dirs:
tests
Expand Down
4 changes: 4 additions & 0 deletions packages/distributed-process-client-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

2024-10-30 Laurent P. René de Cotret <[email protected]> 0.2.7.0

* Removed dependency on `rematch` (#459)

2024-09-03 Laurent P. René de Cotret <[email protected]> 0.2.6.0

* Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: distributed-process-client-server
version: 0.2.6.0
version: 0.2.7.0
build-type: Simple
license: BSD-3-Clause
license-file: LICENCE
Expand Down Expand Up @@ -79,7 +79,7 @@ test-suite ManagedProcessTests
distributed-process-extras,
distributed-process-async,
distributed-process-client-server,
distributed-process-systest >= 0.1.1,
distributed-process-systest ^>= 0.4,
network-transport >= 0.4 && < 0.7,
mtl,
fingertree,
Expand All @@ -92,7 +92,6 @@ test-suite ManagedProcessTests
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
transformers,
rematch >= 0.2.0.0,
ghc-prim,
exceptions
other-modules: Counter,
Expand All @@ -118,7 +117,7 @@ test-suite PrioritisedProcessTests
distributed-process-extras,
distributed-process-async,
distributed-process-client-server,
distributed-process-systest >= 0.1.1,
distributed-process-systest ^>= 0.4,
network-transport,
mtl,
fingertree,
Expand All @@ -131,7 +130,6 @@ test-suite PrioritisedProcessTests
test-framework,
test-framework-hunit,
transformers,
rematch,
ghc-prim,
exceptions
other-modules: ManagedProcessCommon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Control.Distributed.Process.ManagedProcess
import Control.Distributed.Process.SysTest.Utils
import Control.Distributed.Process.Extras.Time
import Control.Distributed.Process.Serializable()
import Control.Monad (replicateM_)

import MathsDemo
import Counter
Expand Down Expand Up @@ -197,7 +198,7 @@ testCounterExceedsLimit result = do
mref <- monitor pid

-- exceed the limit
9 `times` (void $ incCount pid)
9 `replicateM_` (void $ incCount pid)

-- this time we should fail
_ <- (incCount pid)
Expand Down
4 changes: 4 additions & 0 deletions packages/distributed-process-execution/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-10-30 Laurent P. René de Cotret <[email protected]> 0.1.4.0

* Removed dependency on `rematch` (#459)

2024-09-03 Laurent P. René de Cotret <[email protected]> 0.1.3.0

* Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: distributed-process-execution
version: 0.1.3.0
version: 0.1.4.0
build-type: Simple
license: BSD-3-Clause
license-file: LICENCE
Expand Down Expand Up @@ -79,7 +79,7 @@ test-suite ExchangeTests
distributed-process,
distributed-process-execution,
distributed-process-extras,
distributed-process-systest >= 0.1.1 && < 0.4,
distributed-process-systest ^>= 0.4,
distributed-static,
bytestring,
data-accessor,
Expand All @@ -98,7 +98,6 @@ test-suite ExchangeTests
QuickCheck >= 2.4,
test-framework-quickcheck2,
transformers,
rematch >= 0.2.0.0,
ghc-prim
hs-source-dirs:
tests
Expand All @@ -120,7 +119,7 @@ test-suite MailboxTests
distributed-process,
distributed-process-execution,
distributed-process-extras,
distributed-process-systest >= 0.1.1 && < 0.4,
distributed-process-systest ^>= 0.4,
distributed-static,
bytestring,
data-accessor,
Expand All @@ -139,7 +138,6 @@ test-suite MailboxTests
QuickCheck >= 2.4,
test-framework-quickcheck2,
transformers,
rematch >= 0.2.0.0,
ghc-prim
hs-source-dirs:
tests
Expand Down
46 changes: 25 additions & 21 deletions packages/distributed-process-execution/tests/TestExchange.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import qualified Control.Distributed.Process.Execution.EventManager as EventMana
)
import Control.Distributed.Process.SysTest.Utils
import Control.Monad (void, forM, forever)
import Control.Rematch (equalTo)

import Prelude hiding (drop)
import Network.Transport.TCP
import qualified Network.Transport as NT
import Test.Framework as TF (defaultMain, testGroup, Test)
import Test.Framework.Providers.HUnit
import Test.HUnit (assertEqual, assertBool)

testKeyBasedRouting :: TestResult Bool -> Process ()
testKeyBasedRouting result = do
Expand Down Expand Up @@ -67,20 +67,22 @@ testMultipleRoutes result = do
received <- forM (replicate (2 * 3) us) (const $ receiveChanTimeout 1000 rp)

-- all bindings for 'abc' fired correctly
received `shouldContain` Just (p1, Left "Hello")
received `shouldContain` Just (p3, Left "Hello")
received `shouldContain` Just (p1, Right (123 :: Int))
received `shouldContain` Just (p3, Right (123 :: Int))

-- however the bindings for 'def' never fired
received `shouldContain` Nothing
received `shouldNotContain` Just (p2, Left "Hello")
received `shouldNotContain` Just (p2, Right (123 :: Int))

-- none of the bindings should have examined the headers!
received `shouldNotContain` Just (p1, Left "Goodbye")
received `shouldNotContain` Just (p2, Left "Goodbye")
received `shouldNotContain` Just (p3, Left "Goodbye")
liftIO $ do

assertBool mempty $ Just (p1, Left "Hello") `elem` received
assertBool mempty $ Just (p3, Left "Hello") `elem` received
assertBool mempty $ Just (p1, Right (123 :: Int)) `elem` received
assertBool mempty $ Just (p3, Right (123 :: Int)) `elem` received

-- however the bindings for 'def' never fired
assertBool mempty $ Nothing `elem` received
assertBool mempty $ Just (p2, Left "Hello") `notElem` received
assertBool mempty $ Just (p2, Right (123 :: Int)) `notElem` received

-- none of the bindings should have examined the headers!
assertBool mempty $ Just (p1, Left "Goodbye") `notElem` received
assertBool mempty $ Just (p2, Left "Goodbye") `notElem` received
assertBool mempty $ Just (p3, Left "Goodbye") `notElem` received

testHeaderBasedRouting :: TestResult () -> Process ()
testHeaderBasedRouting result = do
Expand Down Expand Up @@ -110,14 +112,16 @@ testHeaderBasedRouting result = do
received <- forM (replicate 5 us) (const $ receiveChanTimeout 1000 rp)

-- all bindings fired correctly
received `shouldContain` Just (p1, Left "Hello")
received `shouldContain` Just (p1, Right (123 :: Int))
received `shouldContain` Just (p2, Right (456 :: Int))
received `shouldContain` Just (p2, Right (789 :: Int))
received `shouldContain` Nothing
liftIO $ do
assertBool mempty $ Just (p1, Left "Hello") `elem` received
assertBool mempty $ Just (p1, Left "Hello") `elem` received
assertBool mempty $ Just (p1, Right (123 :: Int)) `elem` received
assertBool mempty $ Just (p2, Right (456 :: Int)) `elem` received
assertBool mempty $ Just (p2, Right (789 :: Int)) `elem` received
assertBool mempty $ Nothing `elem` received

-- simple check that no other bindings have fired
length received `shouldBe` equalTo (5 :: Int)
liftIO $ assertEqual mempty 5 (length received)

testSimpleEventHandling :: TestResult Bool -> Process ()
testSimpleEventHandling result = do
Expand Down
11 changes: 5 additions & 6 deletions packages/distributed-process-execution/tests/TestMailbox.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ import Control.Distributed.Process.Extras.Time
import Control.Distributed.Process.Extras.Timer
import Control.Distributed.Process.SysTest.Utils


import Control.Rematch (equalTo)

import Prelude hiding (drop)

import Data.Maybe (catMaybes)

import Test.Framework as TF (defaultMain, testGroup, Test)
import Test.Framework.Providers.HUnit
import Test.HUnit (assertEqual)

import qualified MailboxTestFilters (__remoteTable)
import MailboxTestFilters (myFilter, intFilter)
Expand Down Expand Up @@ -77,9 +75,10 @@ bufferLimiting buffT result = do
MailboxStats{ pendingMessages = pending'
, droppedMessages = dropped'
, currentLimit = limit' } <- statistics mbox
pending' `shouldBe` equalTo 4
dropped' `shouldBe` equalTo 3
limit' `shouldBe` equalTo 4
liftIO $ do
assertEqual mempty 4 pending'
assertEqual mempty 3 dropped'
assertEqual mempty 4 limit'

active mbox acceptEverything
Just Delivery{ messages = recvd
Expand Down
4 changes: 4 additions & 0 deletions packages/distributed-process-extras/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-10-30 Laurent P. René de Cotret <[email protected]> 0.3.7

* Removed dependency on `rematch` (#459)

2024-09-03 Laurent P. René de Cotret <[email protected]> 0.3.6

* Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: distributed-process-extras
version: 0.3.6
version: 0.3.7
build-type: Simple
license: BSD-3-Clause
license-file: LICENCE
Expand Down Expand Up @@ -75,13 +75,12 @@ test-suite InternalQueueTests
ansi-terminal >= 0.5 && < 0.9,
distributed-process >= 0.6.0 && < 0.8,
distributed-process-extras,
distributed-process-systest >= 0.1.0 && < 0.4,
distributed-process-systest ^>= 0.4,
HUnit >= 1.2 && < 2,
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
QuickCheck >= 2.4,
test-framework-quickcheck2,
rematch >= 0.2.0.0,
ghc-prim
hs-source-dirs: tests
ghc-options: -rtsopts
Expand All @@ -98,7 +97,7 @@ test-suite PrimitivesTests
ansi-terminal >= 0.5 && < 0.9,
distributed-process >= 0.6.0 && < 0.8,
distributed-process-extras,
distributed-process-systest >= 0.1.0 && < 0.4,
distributed-process-systest ^>= 0.4,
network-transport >= 0.4 && < 0.6,
mtl,
containers,
Expand All @@ -110,7 +109,6 @@ test-suite PrimitivesTests
stm,
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
rematch >= 0.2.0.0,
transformers
hs-source-dirs: tests
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
Expand All @@ -127,15 +125,14 @@ test-suite TimerTests
deepseq,
distributed-process >= 0.6.0 && < 0.8,
distributed-process-extras,
distributed-process-systest >= 0.1.0 && < 0.4,
distributed-process-systest ^>= 0.4,
network-transport >= 0.4 && < 0.6,
network-transport-tcp >= 0.4 && < 0.9,
HUnit >= 1.2 && < 2,
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
QuickCheck >= 2.4,
test-framework-quickcheck2,
rematch >= 0.2.0.0,
ghc-prim
hs-source-dirs: tests
ghc-options: -rtsopts
Expand All @@ -155,7 +152,7 @@ test-suite LoggerTests
unordered-containers >= 0.2.3.0 && < 0.3,
distributed-process >= 0.6.0 && < 0.8,
distributed-process-extras,
distributed-process-systest >= 0.1.0 && < 0.4,
distributed-process-systest ^>= 0.4,
distributed-static,
bytestring,
data-accessor,
Expand All @@ -172,7 +169,6 @@ test-suite LoggerTests
test-framework >= 0.6 && < 0.9,
test-framework-hunit,
transformers,
rematch >= 0.2.0.0,
ghc-prim
hs-source-dirs: tests
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
Expand Down
4 changes: 1 addition & 3 deletions packages/distributed-process-extras/tests/TestLog.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

module Main where

-- import Control.Exception (SomeException)
import Control.Concurrent.MVar (MVar, newMVar, takeMVar, putMVar, newEmptyMVar)
import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TChan
import Control.Distributed.Process hiding (monitor)
import Control.Distributed.Process.Closure (remotable, mkStaticClosure)
import Control.Distributed.Process.Node
import Control.Distributed.Process.Extras hiding (__remoteTable)
import qualified Control.Distributed.Process.Extras.SystemLog as Log (Logger, error)
import qualified Control.Distributed.Process.Extras.SystemLog as Log (Logger)
import Control.Distributed.Process.Extras.SystemLog hiding (Logger, error)
import Control.Distributed.Process.SysTest.Utils
import Control.Distributed.Process.Extras.Time
Expand All @@ -31,7 +30,6 @@ import GHC.Read
import Text.ParserCombinators.ReadP as P
import Text.ParserCombinators.ReadPrec

import qualified Network.Transport as NT

logLevelFormatter :: Message -> Process (Maybe String)
logLevelFormatter m = handleMessage m showLevel
Expand Down
Loading

0 comments on commit 5ff75cd

Please sign in to comment.