hpc-coveralls 0.6.0 → 0.6.1
raw patch · 5 files changed
+16/−7 lines, 5 filesdep +safePVP ok
version bump matches the API change (PVP)
Dependencies added: safe
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- README.md +1/−1
- hpc-coveralls.cabal +3/−1
- src/HpcCoverallsMain.hs +2/−2
- src/Trace/Hpc/Coveralls/Curl.hs +5/−3
CHANGELOG.md view
@@ -1,3 +1,8 @@+[0.6.1](https://github.com/guillaume-nargeot/hpc-coveralls/issues?milestone=8&state=closed)+-----+* Safer implementation of the result coverage value retrieval from coveralls.io (issue 25)+* Set the delay before retrieving the result to 10 seconds (issue #26)+ [0.6.0](https://github.com/guillaume-nargeot/hpc-coveralls/issues?milestone=7&state=closed) ----- * Add flag to print the raw json responses from coveralls.io (issue #24)
README.md view
@@ -1,4 +1,4 @@-hpc-coveralls [](https://travis-ci.org/guillaume-nargeot/hpc-coveralls) [](https://gitter.im/guillaume-nargeot/hpc-coveralls) [](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29) [](http://hackage.haskell.org/package/hpc-coveralls-0.6.0)+hpc-coveralls [](https://travis-ci.org/guillaume-nargeot/hpc-coveralls) [](https://gitter.im/guillaume-nargeot/hpc-coveralls) [](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29) [](http://hackage.haskell.org/package/hpc-coveralls-0.6.1) ============= hpc-coveralls converts and sends Haskell projects hpc code coverage to [coverall.io](http://coveralls.io/).
hpc-coveralls.cabal view
@@ -1,5 +1,5 @@ name: hpc-coveralls-version: 0.6.0+version: 0.6.1 synopsis: Coveralls.io support for Haskell. description: This utility converts and sends Haskell projects hpc code coverage to@@ -60,6 +60,7 @@ cmdargs >= 0.10, curl >= 1.3.8, hpc >= 0.6,+ safe >= 0.3, split executable hpc-coveralls@@ -73,6 +74,7 @@ cmdargs >= 0.10, curl >= 1.3.8, hpc >= 0.6,+ safe >= 0.3, split ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
src/HpcCoverallsMain.hs view
@@ -57,8 +57,8 @@ case response of PostSuccess url -> do putStrLn ("URL: " ++ url)- -- wait 5 seconds until the page is available- threadDelay (5 * 10000000)+ -- wait 10 seconds until the page is available+ threadDelay (10 * 1000000) coverageResult <- readCoverageResult url (printResponse hca) case coverageResult of Just totalCoverage -> putStrLn ("Coverage: " ++ totalCoverage) >> exitSuccess
src/Trace/Hpc/Coveralls/Curl.hs view
@@ -12,6 +12,7 @@ module Trace.Hpc.Coveralls.Curl ( postJson, readCoverageResult, PostResult (..) ) where +import Control.Applicative import Control.Monad import Data.Aeson import Data.Aeson.Types (parseMaybe)@@ -19,6 +20,7 @@ import Data.List.Split import Data.Maybe import Network.Curl+import Safe import Trace.Hpc.Coveralls.Types parseResponse :: CurlResponse -> PostResult@@ -51,8 +53,8 @@ -- page content. -- The current implementation is kept as low level as possible in order not -- to increase the library build time, by not relying on additional packages.-extractCoverage :: String -> String-extractCoverage = head . splitOn "<" . (!! 1) . splitOn prefix+extractCoverage :: String -> Maybe String+extractCoverage body = splitOn "<" <$> splitOn prefix body `atMay` 1 >>= headMay where prefix = "div class='coverage'>\n<strong>" -- | Read the coveraege result page from coveralls.io@@ -63,5 +65,5 @@ response <- curlGetString url [] when printResponse $ putStrLn $ snd response return $ case response of- (CurlOK, body) -> Just $ extractCoverage body+ (CurlOK, body) -> extractCoverage body _ -> Nothing