haskell.nix icon indicating copy to clipboard operation
haskell.nix copied to clipboard

No way to specify binaries needed by tests

Open nc6 opened this issue 5 years ago • 4 comments

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];
        }

nc6 avatar Jun 17 '19 07:06 nc6

Try:

packages.funflow.components.tests.unit-tests.testWrapper = "PATH=${pkgs.coreutils}/bin:$PATH";

hamishmack avatar Jun 17 '19 09:06 hamishmack

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.

hamishmack avatar Jun 19 '19 12:06 hamishmack

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

rvl avatar Jun 20 '19 02:06 rvl

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.

stale[bot] avatar Sep 29 '22 01:09 stale[bot]