From b1ad729add0714cd123ea96497adf0ef14f683c4 Mon Sep 17 00:00:00 2001 From: Olmo Kramer Date: Sun, 3 Mar 2024 13:51:40 +0100 Subject: [PATCH] Add test for `nix flake update` with multiple inputs --- tests/functional/flakes/flakes.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index 7506b6b3b..427290883 100644 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -564,6 +564,16 @@ nix flake lock "$flake3Dir" nix flake update flake2/flake1 --flake "$flake3Dir" [[ $(jq -r .nodes.flake1_2.locked.rev "$flake3Dir/flake.lock") =~ $hash2 ]] +# Test updating multiple inputs. +nix flake lock "$flake3Dir" --override-input flake1 flake1/master/$hash1 +nix flake lock "$flake3Dir" --override-input flake2/flake1 flake1/master/$hash1 +[[ $(jq -r .nodes.flake1.locked.rev "$flake3Dir/flake.lock") =~ $hash1 ]] +[[ $(jq -r .nodes.flake1_2.locked.rev "$flake3Dir/flake.lock") =~ $hash1 ]] + +nix flake update flake1 flake2/flake1 --flake "$flake3Dir" +[[ $(jq -r .nodes.flake1.locked.rev "$flake3Dir/flake.lock") =~ $hash2 ]] +[[ $(jq -r .nodes.flake1_2.locked.rev "$flake3Dir/flake.lock") =~ $hash2 ]] + # Test 'nix flake metadata --json'. nix flake metadata "$flake3Dir" --json | jq .