about summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-01-10 16:02:36 +0100
committerSilvan Mosberger <contact@infinisil.com>2020-01-10 16:02:36 +0100
commit092107cdc11f83ab7f2cd2e7302142f661cea2d4 (patch)
tree35b8683027b4c8489ec5c3edaf7ee30d0cbcbdea /lib/tests
parentddc83e68ccf088a99d1ac4f07feee6fdcd593418 (diff)
downloadnixlib-092107cdc11f83ab7f2cd2e7302142f661cea2d4.tar
nixlib-092107cdc11f83ab7f2cd2e7302142f661cea2d4.tar.gz
nixlib-092107cdc11f83ab7f2cd2e7302142f661cea2d4.tar.bz2
nixlib-092107cdc11f83ab7f2cd2e7302142f661cea2d4.tar.lz
nixlib-092107cdc11f83ab7f2cd2e7302142f661cea2d4.tar.xz
nixlib-092107cdc11f83ab7f2cd2e7302142f661cea2d4.tar.zst
nixlib-092107cdc11f83ab7f2cd2e7302142f661cea2d4.zip
lib/tests: Fix module tests
Fix the broken test in https://github.com/NixOS/nixpkgs/pull/77416

Apparently hydra uses `nix-build lib/tests/release.nix` to run all
tests, where IFD isn't allowed. Fortunately we can get around this with
builtins.toFile, which doesn't require IFD, but still can test the
properties we want.
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/modules/import-from-store.nix12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/tests/modules/import-from-store.nix b/lib/tests/modules/import-from-store.nix
index 64e7ec2e388c..f5af22432ce1 100644
--- a/lib/tests/modules/import-from-store.nix
+++ b/lib/tests/modules/import-from-store.nix
@@ -1,17 +1,11 @@
 { lib, ... }:
-let
-  drv = derivation {
-    name = "derivation";
-    system = builtins.currentSystem;
-    builder = "/bin/sh";
-    args = [ "-c" "echo {} > $out" ];
-  };
-in {
+{
 
   imports = [
-    "${drv}"
+    "${builtins.toFile "drv" "{}"}"
     ./declare-enable.nix
     ./define-enable.nix
   ];
 
 }
+