aboutsummaryrefslogtreecommitdiff
path: root/tests/flakes.sh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-05 14:48:49 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-02-05 14:48:49 +0100
commit9d7fb62db6e8ee6da7f8dbc5f5509271dc12f2ba (patch)
tree300a38d1bb67fb80b297b3d05e8e1425547fd2f8 /tests/flakes.sh
parente2213d77a22a1d3d5d17167eb2760352760405e8 (diff)
Add option --commit-lock-file
Diffstat (limited to 'tests/flakes.sh')
-rw-r--r--tests/flakes.sh11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/flakes.sh b/tests/flakes.sh
index 63e7f8e87..434f5cb7a 100644
--- a/tests/flakes.sh
+++ b/tests/flakes.sh
@@ -170,10 +170,9 @@ nix build -o $TEST_ROOT/result $flake2Dir#bar --no-update-lock-file 2>&1 | grep
# 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
+nix build -o $TEST_ROOT/result $flake2Dir#bar --commit-lock-file
[[ -e $flake2Dir/flake.lock ]]
-git -C $flake2Dir add flake.lock
-git -C $flake2Dir commit flake.lock -m 'Add flake.lock'
+[[ -z $(git -C $flake2Dir diff master) ]]
# Rerunning the build should not change the lockfile.
nix build -o $TEST_ROOT/result $flake2Dir#bar
@@ -291,11 +290,7 @@ git -C $flake3Dir commit -m 'Add nonFlakeInputs'
# Check whether `nix build` works with a lockfile which is missing a
# nonFlakeInputs.
-nix build -o $TEST_ROOT/result $flake3Dir#sth
-
-git -C $flake3Dir add flake.lock
-
-git -C $flake3Dir commit -m 'Update nonFlakeInputs'
+nix build -o $TEST_ROOT/result $flake3Dir#sth --commit-lock-file
nix build -o $TEST_ROOT/result flake3#fnord
[[ $(cat $TEST_ROOT/result) = FNORD ]]