@@ -19,22 +19,29 @@ import Control.Concurrent (MVar, killThread, newEmptyMVar, putMVar, readMVar)
1919import Control.Concurrent.Lifted (forkFinally )
2020import Control.Exception.Lifted (bracket )
2121import Control.Monad.Trans.Control (MonadBaseControl )
22+ import Data.Bool (bool )
2223import Data.ByteString (ByteString )
2324import Data.Map qualified as Map
2425import Data.Monoid (Any )
2526import Data.Set qualified as Set
27+ import Data.String (fromString )
2628import Lens.Micro ((&) )
2729import Network.Socket
2830import Network.Socket.ByteString (sendAll )
2931import System.Directory (removeFile )
32+ import System.Info qualified as SYS
3033
3134import Test.Cardano.Ledger.Common (HasCallStack , when )
3235
3336import Hedgehog (MonadTest , Property , success )
3437import Hedgehog qualified as H
3538import Hedgehog.Extras qualified as H
39+ import Hedgehog.Extras.Stock.OS (isWin32 )
3640import Test.Tasty (TestTree , testGroup )
37- import Test.Tasty.Hedgehog
41+ import Test.Tasty.ExpectedFailure (wrapTest )
42+ import Test.Tasty.Hedgehog qualified as H
43+ import Test.Tasty.Providers (testPassed )
44+ import Test.Tasty.Runners (Result (resultShortDescription ))
3845
3946prop_mockInteractionWithNode :: Property
4047prop_mockInteractionWithNode =
@@ -188,9 +195,28 @@ tests :: TestTree
188195tests =
189196 testGroup
190197 " Test.Cardano.Api.IPC"
191- [ testProperty " Test mock interation with node" prop_mockInteractionWithNode
198+ [ ignoreOnMacAndWindows " Test mock interation with node" prop_mockInteractionWithNode
192199 ]
193200
201+ type Os = String
202+
203+ isMacOS :: Bool
204+ isMacOS = SYS. os == " darwin"
205+
206+ ignoreOnMacAndWindows :: String -> Property -> TestTree
207+ ignoreOnMacAndWindows pName prop =
208+ bool id (ignoreOn " MacOS and Windows" ) (isMacOS || isWin32) $
209+ H. testPropertyNamed pName (fromString pName) prop
210+
211+ ignoreOn :: Os -> TestTree -> TestTree
212+ ignoreOn os =
213+ wrapTest $
214+ const $
215+ return $
216+ (testPassed (" IGNORED on " <> os))
217+ { resultShortDescription = " IGNORED on " <> os
218+ }
219+
194220-- | Creates a mock node socket that replays the binary data from the given file.
195221-- To capture the raw data you could run @socat@ like this:
196222--
0 commit comments