on master help sign in
Hide tests failing on CI behind DEVBUILD flag.

Closes #738

commit6da528b9bb52d7ef28d6cd95b51840a5d1f92306 authorpranaysashank <pranaysashank@composewell.com> dateMon 26 Oct 2020, 13:25 (6 years ago) parentc213835
4 files changed+19−6
test/Streamly/Test/Prelude/Async.hs+2 test/Streamly/Test/Prelude/Concurrent.hs+5−3 test/Streamly/Test/Prelude/Parallel.hs+4−2 test/Streamly/Test/Prelude/Serial.hs+8−1
test/Streamly/Test/Prelude/Async.hs+2
@@ -92,8 +92,10 @@ main = hspec
9292 -- for Monoid that is using the right version of semigroup. Instance
9393 -- deriving can cause us to pick wrong instances sometimes.
9494
95+#ifdef DEVBUILD
9596 describe "Async (<>) time order check" $ parallelCheck asyncly (<>)
9697 describe "Async mappend time order check" $ parallelCheck asyncly mappend
98+#endif
9799
98100 describe "Composed MonadThrow asyncly" $ composeWithMonadThrow asyncly
99101
test/Streamly/Test/Prelude/Concurrent.hs+5−3
@@ -19,7 +19,7 @@ import Control.Monad (void, when, forM_, replicateM_)
1919import Control.Monad.IO.Class (MonadIO(liftIO))
2020import Control.Monad.State (MonadState, get, modify, runStateT
2121 , StateT(..), evalStateT)
22−import Data.Foldable (fold)
22+import Data.Foldable (fold)
2323import Data.IORef (readIORef, modifyIORef, newIORef)
2424#if !(MIN_VERSION_base(4,11,0))
2525import Data.Semigroup (Semigroup, (<>))
@@ -410,7 +410,7 @@ main = hspec
410410 concurrentFoldrApplication
411411 prop "concurrent foldl application" $ withMaxSuccess maxTestCount
412412 concurrentFoldlApplication
413−
413+
414414 describe "take on infinite concurrent stream" $ takeInfinite asyncly
415415 describe "take on infinite concurrent stream" $ takeInfinite wAsyncly
416416 describe "take on infinite concurrent stream" $ takeInfinite aheadly
@@ -418,7 +418,7 @@ main = hspec
418418 ---------------------------------------------------------------------------
419419 -- Monadic state transfer in concurrent tasks
420420 ---------------------------------------------------------------------------
421−
421+
422422 describe "Monadic state transfer in concurrent tasks" $ do
423423 -- XXX Can we write better test cases to hit every case?
424424 it "async: state is saved and used if the work is partially enqueued"
@@ -478,6 +478,7 @@ main = hspec
478478 replicate 4000 $ S.yieldM $ threadDelay 1000000)
479479 `shouldReturn` ()
480480
481+#ifdef DEVBUILD
481482 describe "restricts concurrency and cleans up extra tasks" $ do
482483 it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1)
483484 it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1)
@@ -486,3 +487,4 @@ main = hspec
486487 it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0))
487488 it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0))
488489 it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0))
490+#endif
test/Streamly/Test/Prelude/Parallel.hs+4−2
@@ -91,13 +91,15 @@ main = hspec
9191 parallelOps $ eliminationOps folded "parallely folded"
9292 parallelOps $ eliminationOpsWord8 S.fromFoldable "parallely"
9393 parallelOps $ eliminationOpsWord8 folded "parallely folded"
94−
94+
9595 -- test both (<>) and mappend to make sure we are using correct instance
9696 -- for Monoid that is using the right version of semigroup. Instance
9797 -- deriving can cause us to pick wrong instances sometimes.
9898
99+#ifdef DEVBUILD
99100 describe "Parallel (<>) time order check" $ parallelCheck parallely (<>)
100101 describe "Parallel mappend time order check" $ parallelCheck parallely mappend
102+#endif
101103
102104 describe "Composed MonadThrow parallely" $ composeWithMonadThrow parallely
103105
@@ -106,4 +108,4 @@ main = hspec
106108 -- the events, but that would make tests even slower.
107109 it "take 1 parallely" $ checkCleanup 3 parallely (S.take 1)
108110 it "takeWhile (< 0) parallely" $ checkCleanup 3 parallely (S.takeWhile (< 0))
109−#endif
111+#endif
test/Streamly/Test/Prelude/Serial.hs+8−1
@@ -43,7 +43,10 @@ import qualified Streamly.Internal.Data.Unfold as UF
4343import qualified Streamly.Internal.Data.Stream.IsStream as IS
4444import Streamly.Internal.Data.Time.Units
4545 (AbsTime, NanoSecond64(..), toRelTime64, diffAbsTime64)
46+
47+#ifdef DEVBUILD
4648import Streamly.Internal.Data.Time.Clock (Clock(Monotonic), getTime)
49+#endif
4750
4851import Streamly.Test.Common
4952import Streamly.Test.Prelude.Common
@@ -205,6 +208,7 @@ checkTakeDropTime (mt0, mt1) = do
205208 " tMax = " ++ show tMax
206209 return r
207210
211+#ifdef DEVBUILD
208212testTakeByTime :: IO Bool
209213testTakeByTime = do
210214 r <-
@@ -221,6 +225,7 @@ testDropByTime = do
221225 $ IS.dropByTime takeDropTime
222226 $ S.repeatM (threadDelay 1000 >> getTime Monotonic)
223227 checkTakeDropTime (Just t0, mt1)
228+#endif
224229
225230unfold :: Property
226231unfold = monadicIO $ do
@@ -373,9 +378,11 @@ main = hspec
373378 serialOps $ transformCombineOpsOrdered S.fromFoldable "serially" (==)
374379 serialOps $ transformCombineOpsOrdered folded "serially" (==)
375380
381+#ifdef DEVBUILD
376382 describe "Filtering" $ do
377383 it "takeByTime" (testTakeByTime `shouldReturn` True)
378384 it "dropByTime" (testDropByTime `shouldReturn` True)
385+#endif
379386
380387 describe "Stream group and split operations" $ do
381388 groupSplitOps "serially"
@@ -395,7 +402,7 @@ main = hspec
395402 describe "Tests for S.groupsBy" $ do
396403 prop "testGroupsBy" testGroupsBy
397404 prop "testGroupsBySep" testGroupsBySep
398−
405+
399406 describe "Composed MonadThrow serially" $ composeWithMonadThrow serially
400407
401408 it "fromCallback" $ testFromCallback `shouldReturn` (50*101)