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

Stack support #47

Open valpackett opened 9 years ago

valpackett commented 9 years ago

stack is the new build tool that's better than cabal-install. It uses a different directory layout, so hpc-coveralls currently fails:

Couldn't find the hpc data directory
Couldn't find the directory dist/
Dumping dist/ directory content:
hpc-coveralls: dist/: getDirectoryContents: does not exist (No such file or directory)
killy971 commented 9 years ago

If I understand well, https://github.com/myfreeweb/sweetroll is an example project using stack? Can you please tell me where are the *.tix and *.mix files located in your project once you've run the tests with coverage enabled?

valpackett commented 9 years ago

It doesn't use hpc, but https://github.com/myfreeweb/http-link-header does.

After running tests, tests.tix is created right in the project directory. The .hpc folder with the *.mix stuff is right there too.

mrkkrp commented 8 years ago

Is there any progress on stack support? Do you need help?

rubik commented 8 years ago

I'm interested as well, what needs to be done exactly to support Stack?

rubik commented 8 years ago

I wrote stack-hpc-coveralls, which is based on hpc-coveralls code. It's just an experiment, but at least it's working for my repositories.

The changes are pretty heavy and it's really meant to work with Stack out of the box, with little to no configuration. Therefore I did not submit a PR. I may in the future if the author is interested.

killy971 commented 8 years ago

@rubik You're welcome to help adding support for stack to hpc-coveralls!

It would be nice if we can keep the functionality backward compatible with cabal and be able to auto-detect whether the project is using cabal or stack (or a new flag could be introduced to specify to use stack, and if not specified it would switch back to cabal).

mfine commented 8 years ago

@guillaume-nargeot the files get generated under .stack-work:

$PROJECT_ROOT/.stack-work/install/x86_64-osx/lts-3.9/7.10.2/hpc/skylark-core/test/test.tix

Which is discoverable from the stack tool:

$ stack path --local-hpc-root
$PROJECT_ROOT/.stack-work/install/x86_64-osx/lts-3.9/7.10.2/hpc

And in the stack library: hpcDirFromDir.

ExcaliburZero commented 8 years ago

@guillaume-nargeot Detecting if a project is using Stack or Cabal should be a matter of just looking for the existence of the stack.yaml file in the main directory of the project.

If the file is there, then it should be assumed that the project is using Stack. Or if it is not there, then the project should be assumed to be using Cabal.