Closed peti closed 10 years ago
There are ways to run the tests that don't need internet access. Unfortunately the cabal test
support doesn't seem to be able to pass arguments to the executable, as far as I could tell? I guess I can add checking an environment variable to find out I am under a non-internet VM? Any suggestions?
I believe that these options could be used to pass flags to the test executables during cabal test
:
--test-options=TEMPLATES give extra options to test executables (name
templates can use $pkgid, $compiler, $os, $arch,
$test-suite)
--test-option=TEMPLATE give extra option to test executables (no need to
quote options containing spaces, name template can
use $pkgid, $compiler, $os, $arch, $test-suite)
Alternatively, the test suite could be split into two (or more) executables, and then we run only those executables that don't need Internet access during cabal test
. We've used that option with good success in the dns library.
It seems like --test-option=
Given that hoogle-test
is really just a 3 line program that calls the real hoogle
, and I'm somewhat bitter that I can't just declare my test suite to be hoogle test
(e.g. the normal binary with a command line), I'd rather stay away from adding more test binaries.
How about calling the test program with --no-net
to disable net work access? I don't feel strongly about the name of tha flag, though. Any choice is fine.
I'll add a --no-net
flag. Given the spate of Hoogle releases to fix .cabal issues, and my plans for some real upcoming changes, I'll probably leave this a few weeks. Shout if you think it should be more important.
I've added the feature with --no-net
flag. I'll close the bug once it's released on Hackage.
Thank you for your help!
Fixed in 4.2.27 - let me know if you have any issues with it. I really appreciate the help, testing and notifications I get from the NixOS packagers (and all the packagers in general) - it helps ensure my packages are "right" in all the ways it's easy to forget when just releasing to Hackage.
builds in NixOS are run in a virtualized container environment without network access to ensure that builds are reproducible. Unfortunately, this means that Hoogle's test suite fails in our builds:
To fix the build, I've disabled the test suite entirely.
Now, I reckon there are probably tests in that suite which don't need Internet access? Is there any way to still run those tests?