Skip to content

Commit dff7527

Browse files
committed
remote: Put tests behind io-testsuite flag
Disabled by default since it requires `nix-daemon` binary and Linux namespaces support. For development this can be enabled by ``` cabal configure --flag=io-testsuite ``` or by adding ``` flags: +io-testsuite ``` to `cabal.project.local` Enabled by `callCabal2nixWithOptions` in `overlay.nix` so it is tested by `nix-build` and `nix-shell` brings all test dependencies. This is fine on NixOS where `build-tool-depends: nix:nix-daemon` works and we have namespaces supported.
1 parent 850bafd commit dff7527

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

hnix-store-remote/hnix-store-remote.cabal

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ build-type: Simple
1313
extra-source-files: ChangeLog.md, README.md
1414
cabal-version: >=1.10
1515

16+
flag io-testsuite
17+
default:
18+
False
19+
description:
20+
Enable testsuite, which requires external
21+
binaries and Linux namespace support.
22+
1623
library
1724
exposed-modules: System.Nix.Store.Remote
1825
, System.Nix.Store.Remote.Binary
@@ -45,6 +52,11 @@ library
4552
ghc-options: -Wall
4653

4754
test-suite hnix-store-remote-tests
55+
if !flag(io-testsuite)
56+
buildable: False
57+
58+
build-tool-depends: nix:nix-daemon
59+
4860
ghc-options: -rtsopts -fprof-auto
4961
type: exitcode-stdio-1.0
5062
main-is: Driver.hs

overlay.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ huper: helf: {
22
hnix-store-core =
33
helf.callCabal2nix "hnix-store-core" ./hnix-store-core {};
44
hnix-store-remote =
5-
helf.callCabal2nix "hnix-store-remote" ./hnix-store-remote {};
5+
helf.callCabal2nixWithOptions "hnix-store-remote" ./hnix-store-remote "-fio-testsuite" {};
66
}

0 commit comments

Comments
 (0)