-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#500] Start some basic work on trails service.
- Loading branch information
Showing
9 changed files
with
87 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module Main where | ||
|
||
import Lib | ||
import qualified Mirza.Trails.Main as T (main) | ||
|
||
main :: IO () | ||
main = someFunc | ||
main = T.main |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module Mirza.Trails.Client.Servant where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Mirza.Trails.Main where | ||
main :: IO () | ||
main = putStrLn "Trails..." | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Main where | ||
|
||
import Mirza.Trails.Tests.Client | ||
|
||
import Test.Tasty hiding (withResource) | ||
import Test.Tasty.Runners (NumThreads (..)) | ||
|
||
import Control.Exception (bracket) | ||
import Control.Monad.Except (liftIO, runExceptT) | ||
|
||
main :: IO () | ||
main = do | ||
either (error . show) pure =<< (liftIO $ runExceptT $ makeDatabase testDbNameTrails) | ||
|
||
clientTests <- clientSpec | ||
|
||
defaultMain $ localOption (NumThreads 1) $ testGroup "tests" | ||
[ clientTests | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module Mirza.Trails.Tests.Client where | ||
|
||
|
||
import Mirza.Trails.Client.Servant | ||
|
||
import Mirza.Trails.Tests.InitClient | ||
|
||
import Mirza.Common.Tests.ServantUtils | ||
|
||
import Test.Hspec.Expectations | ||
import Test.Tasty | ||
import Test.Tasty.HUnit | ||
|
||
import Control.Exception (bracket) | ||
|
||
|
||
-- === OR Servant Client tests | ||
clientSpec :: IO TestTree | ||
clientSpec = do | ||
|
||
|
||
|
||
|
||
let healthTests = testCaseSteps "Provides health status" $ \step -> | ||
bracket runTrailsApp (\(a,b,_) -> endWaiApp (a,b)) $ \(_tid, baseurl) -> do | ||
let http = runClient baseurl | ||
|
||
step "Status results in 200" | ||
-- healthResult <- http health | ||
-- healthResult `shouldSatisfy` isRight | ||
-- healthResult `shouldBe` (Right HealthResponse) | ||
|
||
|
||
pure $ testGroup "Trails HTTP Client tests" | ||
[ | ||
healthTests | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters