haskell.nix
haskell.nix copied to clipboard
No way to specify binaries needed by tests
I've been testing out haskell.nix on a project here. The unit tests require that various binaries from coreutils
are present, but there's no way to specify packages which should be available during testing. The build-tools
setting does not satisfy this:
packages.funflow.components.tests.unit-tests = {
build-tools = [pkgs.coreutils];
}
Try:
packages.funflow.components.tests.unit-tests.testWrapper = "PATH=${pkgs.coreutils}/bin:$PATH";
I have actually been having some success using build-tools
as you suggested here. I was able to get all the tests we expected to pass working in nix here. I wonder if maybe I am using a newer version of haskell.nix
. I am using the hkm/asterius-dev-5
branch, but I don't think it has anything in that would affect how tests are run.
This works for me also. I am wondering if it's because you have two test-suite components and both of them need coreutils?
If you put build-tools: coreutils
into the cabal file then stack-to-nix
will generate the dependency for you. (edit: although that might look redundant because most distros have coreutils installed).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.