killy971 / hpc-coveralls

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

Add stack support #69

Open mizunashi-mana opened 7 years ago

mizunashi-mana commented 7 years ago

resolve #47

Notice

killy971 commented 7 years ago

Someone created a pull request to add a similar feature to codecov-haskell: guillaume-nargeot/codecov-haskell/pull/12 That change seems simpler, but I can't judge yet whether it provides the same flexibility as your change...

mizunashi-mana commented 7 years ago

@guillaume-nargeot OK, I modified my changes to refer to guillaume-nargeot/codecov-haskell#12

My changes provide below searching flows:

  1. If use-stack-cov enabled, only using stack coverage reports
  2. Both tix-dir/mix-dir provided, use this directories
  3. Other case:
    1. Searching default coverage reports (dist/hpc/dist/hpc/vanilla)
    2. Searching stack coverage reports (stack path --local-hpc-dir)
  4. If not found hpc directories, failed and show error messages

And, to detect stack:

  1. Run stack --version, then if DoesNotExistError raised, failed to use stack
  2. Detect a stack project to use stack path --project-root, then if this is not a stack project, failed to use stack
coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.2%) to 36.0% when pulling 1544d0525b75c9873fbca5f8605da513ff912725 on mizunashi-mana:add-stack-support into 04fe42c4533b3244e9fa1c2772aa5e30baf5eef0 on guillaume-nargeot:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.2%) to 36.0% when pulling 1544d0525b75c9873fbca5f8605da513ff912725 on mizunashi-mana:add-stack-support into 04fe42c4533b3244e9fa1c2772aa5e30baf5eef0 on guillaume-nargeot:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.2%) to 36.0% when pulling 1544d0525b75c9873fbca5f8605da513ff912725 on mizunashi-mana:add-stack-support into 04fe42c4533b3244e9fa1c2772aa5e30baf5eef0 on guillaume-nargeot:master.

MarisaKirisame commented 7 years ago

Can you merge this? I am currently trying to move the hpc generated by stack into cabal's place, but it is failing horribly. Or just some pointer toward what I am doing wrong will help, thx https://travis-ci.org/ThoughtWorksInc/DeepDarkFantasy#L779

jBugman commented 7 years ago

@MarisaKirisame While we wait on it being merged, I just built it in a fork:

Install binary (I did it once in my Docker image):

wget -qO- https://github.com/jBugman/hpc-coveralls/releases/download/stack/coveralls.tar.gz | \
    tar xvz -C {DIR_IN_A_PATH}

Upload report:

timeout 10
hpc-coveralls {TEST_SUITE_NAME}
--tix-dir=$(stack path --local-hpc-root)/{LIBRARY_NAME}
--mix-dir=$(stack path --dist-dir)/hpc
--repo-token=$COVERALLS_TOKEN
|| true

Timeout is there because it just hangs after a successful upload for a more than a minute for some reason.

MarisaKirisame commented 7 years ago

Thx, I had already used stack-hpc-coveralls, it is working well. @jBugman