killy971 / codecov-haskell

codecov.io support for haskell code coverage with hpc
http://hackage.haskell.org/package/codecov-haskell
BSD 3-Clause "New" or "Revised" License
29 stars 16 forks source link

Fix coverage result response reading #5

Closed killy971 closed 9 years ago

killy971 commented 9 years ago

The following change was introduced on codecov server side, apparently by https://github.com/codecov/codecov-python/commit/2eab8f9a5b50dce28c6c187cf41961da5f4cda57: instead of containing the total coverage result as a value, the response to codecov initial post request now contains a url (wait_url element in the json content). Reading this url should return the coverage result in json format as in the example below:

{"coverage": 42}

Here is the code showing how codecov-python implements the functionality to wait and read the total coverage result.

killy971 commented 9 years ago

The logic should be easy to implement in a similar to what was done to read and parse the page linked from coveralls response (See https://github.com/guillaume-nargeot/hpc-coveralls/issues/21).

stevepeak commented 9 years ago

I did a poor job of announcing this change. Thanks @guillaume-nargeot for recognizing this.

killy971 commented 9 years ago

No problem Steve!

I've just fixed the problem, and will add retry logic later.

killy971 commented 9 years ago

Feature branch: https://github.com/guillaume-nargeot/codecov-haskell/tree/fix-coverage-response-reading Fixed by 078bca0154f02222d0c1b70b6db7e2e422002f5f

killy971 commented 9 years ago

Another change was required to fix the problem: using the CurlFollowLocation option in order to follow the link returned by HTTP 301 responses. This issue is now fixed as of 1c623d515fb1eb1873a3855b1b45f42899e8fb61