hpc-coveralls icon indicating copy to clipboard operation
hpc-coveralls copied to clipboard

Add stack support

Open mizunashi-mana opened this issue 7 years ago • 8 comments

resolve #47

  • Test project: https://github.com/mizunashi-mana/test-hpc-coveralls
  • Travis result: https://travis-ci.org/mizunashi-mana/test-hpc-coveralls
  • Coveralls: https://coveralls.io/github/mizunashi-mana/test-hpc-coveralls

Notice

  • Not support multiple stack package

mizunashi-mana avatar Jun 07 '17 19:06 mizunashi-mana

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...

killy971 avatar Jun 17 '17 13:06 killy971

@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

mizunashi-mana avatar Jun 18 '17 03:06 mizunashi-mana

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 avatar Jun 18 '17 12:06 coveralls

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 avatar Jun 18 '17 13:06 coveralls

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 avatar Jun 18 '17 13:06 coveralls

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

MarisaKirisame avatar Aug 17 '17 17:08 MarisaKirisame

@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.

jBugman avatar Aug 17 '17 23:08 jBugman

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

MarisaKirisame avatar Aug 18 '17 01:08 MarisaKirisame