core: use port 7001 for test server (#1857)

* core: use port 7001 for test server

* enable only failing tests

* start/stop server for every test

* log message that failed to parse

* stop chat synchronously

* print call stack

* add HasCallStack

* increase test timeout

* add call stacks

* more call stacks

* fix test

* disable failing test

* add delay between the tests

* make delay more visible

* remove change in error message

* reduce test delay, increase timeout

* increase delay between the tests

* run each test with a database in a different folder

* folder name

* refactor

* update nix file, more stacks
This commit is contained in:
Evgeny Poberezkin authored and GitHub committed 2023-01-31 11:07:48 +00:00
1 parent 4815e447fa
commit a1ed0a84b8
11 files changed
+464 -467

No files matched your search

+15 -11
View File
@@ -1,25 +1,29 @@
import ChatClient
import ChatTests
-- import Control.Logger.Simple
import Control.Concurrent (threadDelay)
import Control.Logger.Simple
import Data.Time.Clock.System
import MarkdownTests
import MobileTests
import ProtocolTests
import SchemaDump
import Test.Hspec
import UnliftIO.Temporary (withTempDirectory)
main :: IO ()
main = do
-- setLogLevel LogDebug -- LogError
-- withGlobalLogging logCfg $
withSmpServer . hspec $ do
setLogLevel LogError -- LogDebug
withGlobalLogging logCfg . hspec $ do
describe "SimpleX chat markdown" markdownTests
describe "SimpleX chat protocol" protocolTests
describe "Mobile API Tests" mobileTests
-- Workaround for SQLite IO error in first test after mobile tests on Mac
it "Delay after Mobile API Tests" $ threadDelay 100000
describe "SimpleX chat client" chatTests
describe "Schema dump" schemaDumpTest
around testBracket $ do
describe "Mobile API Tests" mobileTests
describe "SimpleX chat client" chatTests
where
testBracket test = do
t <- getSystemTime
let ts = show (systemSeconds t) <> show (systemNanoseconds t)
withSmpServer $ withTmpFiles $ withTempDirectory "tests" ("tmp" <> ts) test
-- logCfg :: LogConfig
-- logCfg = LogConfig {lc_file = Nothing, lc_stderr = True}
logCfg :: LogConfig
logCfg = LogConfig {lc_file = Nothing, lc_stderr = True}