tmp-proc 0.5.2.0 → 0.5.2.1
raw patch · 3 files changed
+16/−19 lines, 3 filesdep −connectiondep −http-client-tlsdep −reqdep ~waidep ~warpdep ~warp-tlsPVP ok
version bump matches the API change (PVP)
Dependencies removed: connection, http-client-tls, req
Dependency ranges changed: wai, warp, warp-tls
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- README.lhs +11/−10
- tmp-proc.cabal +1/−9
ChangeLog.md view
@@ -2,6 +2,10 @@ `tmp-proc` uses [PVP Versioning][1]. +## 0.5.2.1 -- 2023-07-17++* Avoid non-building dependencies in the testable README+ ## 0.5.2.0 -- 2023-07-12 * Bump minimum required version of warp-tls
README.lhs view
@@ -43,8 +43,8 @@ import Data.Proxy (Proxy (..)) import Data.Text (Text) import qualified Data.Text as Text-import Network.HTTP.Req-+import qualified Network.HTTP.Client as HC+import Network.HTTP.Types.Status (statusCode) import System.TmpProc (HList (..), HandlesOf, HostIpAddress, Pinged (..), Proc (..), ProcHandle (..), SvcURI, manyNamed, startupAll, toPinged,@@ -89,16 +89,17 @@ ```haskell pingImpl :: ProcHandle a -> IO Pinged-pingImpl handle = toPinged @HttpException Proxy $ do- gotStatus <- runReq defaultHttpConfig $ do- r <- req GET (handleUrl handle "/status/200") NoReqBody ignoreResponse $ mempty- pure $ responseStatusCode r- if (gotStatus == 200) then pure OK else pure NotOK+pingImpl handle = toPinged @HC.HttpException Proxy $ do+ gotStatus <- handleGet handle "/status/200"+ if gotStatus == 200 then pure OK else pure NotOK -handleUrl :: ProcHandle a -> Text -> Url 'Http-handleUrl handle urlPath = foldl' (/:) (http $ hAddr handle)- $ Text.splitOn "/" $ Text.dropWhile (== '/') urlPath+handleGet :: ProcHandle a -> Text -> IO Int+handleGet handle urlPath = do+ let theUri = "http://" <> hAddr handle <> "/" <> Text.dropWhile (== '/') urlPath+ manager <- HC.newManager HC.defaultManagerSettings+ getReq <- HC.parseRequest $ Text.unpack theUri+ statusCode . HC.responseStatus <$> HC.httpLbs getReq manager ```
tmp-proc.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: tmp-proc-version: 0.5.2.0+version: 0.5.2.1 synopsis: Run 'tmp' processes in integration tests description: @tmp-proc@ runs services in docker containers for use in integration tests.@@ -91,7 +91,6 @@ , hspec , http-client , http-types- , req , text , tmp-proc , wai@@ -140,15 +139,8 @@ build-depends: , base , bytestring- , connection- , data-default , hspec , http-client- , http-client-tls , http-types- , req , text , tmp-proc- , wai- , warp- , warp-tls