Skip to content

Commit

Permalink
Merge #2709
Browse files Browse the repository at this point in the history
2709: Mark LoggingSpec pending on macOS to alleviate timeouts r=Anviking a=Anviking

# Issue Number

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->

ADP-970


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] Mark LoggingSpec pending on macOS


Co-authored-by: Johannes Lund <[email protected]>
  • Loading branch information
iohk-bors[bot] and Anviking authored Jun 15, 2021
2 parents 08f4889 + 127d785 commit a080bd0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/core/test/unit/Network/Wai/Middleware/LoggingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ import Test.QuickCheck
( Arbitrary (..), choose, counterexample, property, withMaxSuccess )
import Test.QuickCheck.Monadic
( assert, monadicIO, monitor )
import Test.Utils.Darwin
( pendingOnMacOS )
import UnliftIO.Async
( Async, async, cancel, mapConcurrently, replicateConcurrently_ )
import UnliftIO.Concurrent
Expand All @@ -113,7 +115,9 @@ import qualified Data.Text as T
import qualified Network.Wai.Handler.Warp as Warp

spec :: Spec
spec = describe "Logging Middleware" $ do
spec = before (pendingOnMacOS "#2472 regular timeouts in macOS hydra builds")
$ describe "Logging Middleware" $ do

before setup $ after tearDown $ do
it "GET, 200, no query" $ \ctx -> do
get ctx "/get"
Expand Down
1 change: 1 addition & 0 deletions lib/test-utils/cardano-wallet-test-utils.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ library
exposed-modules:
Test.Hspec.Extra
Test.QuickCheck.Extra
Test.Utils.Darwin
Test.Utils.FilePath
Test.Utils.Laws
Test.Utils.Laws.PartialOrd
Expand Down
27 changes: 27 additions & 0 deletions lib/test-utils/src/Test/Utils/Darwin.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- |
-- Copyright: © 2018-2021 IOHK
-- License: Apache-2.0
--
-- Utility function for making test suites pass on Darwin/macOS.

module Test.Utils.Darwin
( pendingOnMacOS
) where

import Prelude

import Control.Monad
( when )
import System.Info
( os )
import Test.Hspec.Core.Spec
( pendingWith )
import Test.Hspec.Expectations
( Expectation, HasCallStack )

-- | Mark test pending if running on macOS
pendingOnMacOS :: HasCallStack => String -> Expectation
pendingOnMacOS reason = when isDarwin $ pendingWith reason

isDarwin :: Bool
isDarwin = os == "darwin"

0 comments on commit a080bd0

Please sign in to comment.