diff options
Diffstat (limited to 'tests/flakes.sh')
-rw-r--r-- | tests/flakes.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/flakes.sh b/tests/flakes.sh index 1b1912129..3eae73cdf 100644 --- a/tests/flakes.sh +++ b/tests/flakes.sh @@ -156,9 +156,15 @@ nix path-info $flake1Dir/result (! nix eval --expr "builtins.getFlake \"$flake2Dir\"") # But should succeed in impure mode. -nix build -o $TEST_ROOT/result flake2#bar --impure +(! nix build -o $TEST_ROOT/result flake2#bar --impure) +nix build -o $TEST_ROOT/result flake2#bar --impure --no-write-lock-file -# Test automatic lock file generation. +# Building a local flake with an unlocked dependency should fail with --no-update-lock-file. +nix build -o $TEST_ROOT/result $flake2Dir#bar --no-update-lock-file 2>&1 | grep 'requires lock file changes' + +# But it should succeed without that flag. +nix build -o $TEST_ROOT/result $flake2Dir#bar --no-write-lock-file +nix build -o $TEST_ROOT/result $flake2Dir#bar --no-update-lock-file 2>&1 | grep 'requires lock file changes' nix build -o $TEST_ROOT/result $flake2Dir#bar [[ -e $flake2Dir/flake.lock ]] git -C $flake2Dir add flake.lock |