From e91be79d8eca848d68b3407b1decaf6a486b22d2 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 3 May 2024 17:17:16 +0200 Subject: [PATCH] tests/flakes/follow-paths: test that warning about non-existent input works recursively When I added the warning that an input X has an override for a non-existent input, the recursive flake input override fix wasn't implemented yet[1]. This patch tests that both work together. [1] https://github.com/NixOS/nix/pull/6663 Change-Id: I90dc032029b7160ab4a97d28c480c59d3a6f0150 --- tests/functional/flakes/follow-paths.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/functional/flakes/follow-paths.sh b/tests/functional/flakes/follow-paths.sh index cd3f75693..e91ce87b1 100644 --- a/tests/functional/flakes/follow-paths.sh +++ b/tests/functional/flakes/follow-paths.sh @@ -290,3 +290,20 @@ EOF nix flake update --flake $flakeFollowsA [[ $(jq -c .nodes.B.inputs.D $flakeFollowsA/flake.lock) = '["B","C","D"]' ]] + +cat < $flakeFollowsA/flake.nix +{ + inputs.B.url = "path:$flakeFollowsB"; + inputs.C.url = "path:$flakeFollowsC"; + inputs.B.inputs.C.inputs.E.follows = "C"; + outputs = _: {}; +} +EOF +cat < $flakeFollowsB/flake.nix +{ + inputs.C.url = "path:$flakeFollowsC"; + outputs = _: {}; +} +EOF + +nix flake update --flake $flakeFollowsA 2>&1 | grepQuiet "warning: input 'B/C' has an override for a non-existent input 'E'"