From 2fe9157808ab26e7ca5ac2b7e800c44067d1ef8e Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 23 Jun 2024 15:03:37 +0200 Subject: [PATCH] flakes: add --commit-lock-file message test we had no test to ensure that we generated a commit message at all? Change-Id: Ic9aa8fde92b83e1ea6f61cd2a21867aa73d4e885 --- tests/functional/flakes/flakes.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index 3ef518b23..68a2fd2ce 100644 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -278,6 +278,19 @@ 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 --commit-lock-file +# check that the commit message is broadly correct. we can't check for +# exact contents of the message becase the build dirs change too much. +[[ "$(git -C $flake3Dir show -s --format=format:%B)" = \ +"flake.lock: Update + +Flake lock file updates: + +"?" Added input 'nonFlake': + 'git+file://"*"/flakes/flakes/nonFlake?ref=refs/heads/master&rev="*"' "*" +"?" Added input 'nonFlakeFile': + 'path:"*"/flakes/flakes/nonFlake/README.md?lastModified="*"&narHash=sha256-cPh6hp48IOdRxVV3xGd0PDgSxgzj5N/2cK0rMPNaR4o%3D' "*" +"?" Added input 'nonFlakeFile2': + 'path:"*"/flakes/flakes/nonFlake/README.md?lastModified="*"&narHash=sha256-cPh6hp48IOdRxVV3xGd0PDgSxgzj5N/2cK0rMPNaR4o%3D' "* ]] nix build -o $TEST_ROOT/result flake3#fnord [[ $(cat $TEST_ROOT/result) = FNORD ]]