add test timeout
This commit is contained in:
parent
e0e07c3c24
commit
510b8b57fe
@ -15,7 +15,7 @@ import Simplex.Chat.Core
|
||||
import Simplex.Chat.Options (CoreChatOpts (..))
|
||||
import Simplex.Chat.Types (Profile (..))
|
||||
import System.FilePath ((</>))
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
broadcastBotTests :: SpecWith FilePath
|
||||
broadcastBotTests = do
|
||||
|
@ -21,7 +21,7 @@ import Simplex.Chat.Core
|
||||
import Simplex.Chat.Options (CoreChatOpts (..))
|
||||
import Simplex.Chat.Types (GroupMemberRole (..), Profile (..))
|
||||
import System.FilePath ((</>))
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
directoryServiceTests :: SpecWith FilePath
|
||||
directoryServiceTests = do
|
||||
|
@ -6,7 +6,7 @@ import ChatTests.Files
|
||||
import ChatTests.Groups
|
||||
import ChatTests.Local
|
||||
import ChatTests.Profiles
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
chatTests :: SpecWith FilePath
|
||||
chatTests = do
|
||||
|
@ -4,7 +4,7 @@ import ChatClient
|
||||
import ChatTests.Utils
|
||||
import Data.Time.Clock (getCurrentTime)
|
||||
import Data.Time.Format.ISO8601 (iso8601Show)
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
chatListTests :: SpecWith FilePath
|
||||
chatListTests = do
|
||||
|
@ -24,7 +24,7 @@ import qualified Simplex.Messaging.Crypto as C
|
||||
import Simplex.Messaging.Version
|
||||
import System.Directory (copyFile, doesDirectoryExist, doesFileExist)
|
||||
import System.FilePath ((</>))
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
chatDirectTests :: SpecWith FilePath
|
||||
chatDirectTests = do
|
||||
|
@ -21,7 +21,7 @@ import Simplex.Messaging.Crypto.File (CryptoFile (..), CryptoFileArgs (..))
|
||||
import Simplex.Messaging.Encoding.String
|
||||
import Simplex.Messaging.Util (unlessM)
|
||||
import System.Directory (copyFile, createDirectoryIfMissing, doesFileExist, getFileSize)
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
chatFileTests :: SpecWith FilePath
|
||||
chatFileTests = do
|
||||
|
@ -19,7 +19,7 @@ import qualified Simplex.Messaging.Agent.Store.SQLite.DB as DB
|
||||
import Simplex.Messaging.Version
|
||||
import System.Directory (copyFile)
|
||||
import System.FilePath ((</>))
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
chatGroupTests :: SpecWith FilePath
|
||||
chatGroupTests = do
|
||||
@ -103,7 +103,7 @@ chatGroupTests = do
|
||||
it "new group link host contact should merge with single existing contact out of multiple" testMergeGroupLinkHostMultipleContacts
|
||||
describe "create member contact" $ do
|
||||
it "create contact with group member with invitation message" testMemberContactMessage
|
||||
xit "create contact with group member without invitation message" testMemberContactNoMessage
|
||||
it "create contact with group member without invitation message" testMemberContactNoMessage
|
||||
it "prohibited to create contact with group member if it already exists" testMemberContactProhibitedContactExists
|
||||
it "prohibited to repeat sending x.grp.direct.inv" testMemberContactProhibitedRepeatInv
|
||||
it "invited member replaces member contact reference if it already exists" testMemberContactInvitedConnectionReplaced
|
||||
|
@ -11,7 +11,7 @@ import Data.Time.Format.ISO8601 (iso8601Show)
|
||||
import Simplex.Chat.Controller (ChatConfig (..), InlineFilesConfig (..), defaultInlineFilesConfig)
|
||||
import System.Directory (copyFile, doesFileExist)
|
||||
import System.FilePath ((</>))
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
import UnliftIO.Async (concurrently_)
|
||||
|
||||
chatLocalChatsTests :: SpecWith FilePath
|
||||
|
@ -16,7 +16,7 @@ import Simplex.Chat.Store.Shared (createContact)
|
||||
import Simplex.Chat.Types (ConnStatus (..), GroupMemberRole (..), Profile (..))
|
||||
import Simplex.Messaging.Encoding.String (StrEncoding (..))
|
||||
import System.Directory (copyFile, createDirectoryIfMissing)
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
chatProfileTests :: SpecWith FilePath
|
||||
chatProfileTests = do
|
||||
|
@ -35,7 +35,9 @@ import System.Environment (lookupEnv, withArgs)
|
||||
import System.FilePath ((</>))
|
||||
import System.IO.Silently (capture_)
|
||||
import System.Info (os)
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
import qualified Test.Hspec as Hspec
|
||||
import UnliftIO (timeout)
|
||||
|
||||
defaultPrefs :: Maybe Preferences
|
||||
defaultPrefs = Just $ toChatPrefs defaultChatPrefs
|
||||
@ -55,11 +57,17 @@ cathProfile = Profile {displayName = "cath", fullName = "Catherine", image = Not
|
||||
danProfile :: Profile
|
||||
danProfile = Profile {displayName = "dan", fullName = "Daniel", image = Nothing, contactLink = Nothing, preferences = defaultPrefs}
|
||||
|
||||
xit' :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)
|
||||
it :: HasCallStack => String -> (FilePath -> Expectation) -> SpecWith (Arg (FilePath -> Expectation))
|
||||
it name test =
|
||||
Hspec.it name $ \tmp -> timeout t (test tmp) >>= maybe (error "test timed out") pure
|
||||
where
|
||||
t = 90 * 1000000
|
||||
|
||||
xit' :: HasCallStack => String -> (FilePath -> Expectation) -> SpecWith (Arg (FilePath -> Expectation))
|
||||
xit' = if os == "linux" then xit else it
|
||||
|
||||
xit'' :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)
|
||||
xit'' = ifCI xit it
|
||||
xit'' = ifCI xit Hspec.it
|
||||
|
||||
xdescribe'' :: HasCallStack => String -> SpecWith a -> SpecWith a
|
||||
xdescribe'' = ifCI xdescribe describe
|
||||
|
@ -43,7 +43,7 @@ import Simplex.Messaging.Parsers (dropPrefix, sumTypeJSON)
|
||||
import System.Directory (copyFile)
|
||||
import System.FilePath ((</>))
|
||||
import System.IO (utf8)
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
|
||||
mobileTests :: HasCallStack => SpecWith FilePath
|
||||
mobileTests = do
|
||||
|
@ -21,7 +21,7 @@ import Simplex.Messaging.Crypto.File (CryptoFileArgs (..))
|
||||
import Simplex.Messaging.Encoding.String (strEncode)
|
||||
import Simplex.Messaging.Util
|
||||
import System.FilePath ((</>))
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
import UnliftIO
|
||||
import UnliftIO.Concurrent
|
||||
import UnliftIO.Directory
|
||||
|
@ -12,7 +12,7 @@ import MobileTests
|
||||
import ProtocolTests
|
||||
import RemoteTests
|
||||
import SchemaDump
|
||||
import Test.Hspec
|
||||
import Test.Hspec hiding (it)
|
||||
import UnliftIO.Temporary (withTempDirectory)
|
||||
import ValidNames
|
||||
import ViewTests
|
||||
|
Loading…
Reference in New Issue
Block a user