From a260083919632535ab4639c30ba1ad5a30da8617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Jun 2025 21:07:15 +0200 Subject: [PATCH] fix(vars-check): include generator scripts in test closure The vars-check test was failing because it only included the runtimeInputs of generators but not the actual generator scripts themselves. This caused the test to fail when trying to execute generators that reference local files (like generate.py). Added allGeneratorScripts to the closureInfo to ensure all generator scripts and their dependencies are available in the test environment. --- lib/clanTest/flake-module.nix | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/clanTest/flake-module.nix b/lib/clanTest/flake-module.nix index 174cd8f56..39449b047 100644 --- a/lib/clanTest/flake-module.nix +++ b/lib/clanTest/flake-module.nix @@ -99,10 +99,18 @@ in machine: flip mapAttrsToList machine.clan.core.vars.generators (_name: generator: generator.runtimeInputs); + generatorScripts = + machine: + flip mapAttrsToList machine.clan.core.vars.generators (_name: generator: generator.finalScript); + generatorRuntimeInputs = unique ( flatten (flip mapAttrsToList config.nodes (_machineName: machine: inputsForMachine machine)) ); + allGeneratorScripts = unique ( + flatten (flip mapAttrsToList config.nodes (_machineName: machine: generatorScripts machine)) + ); + vars-check = hostPkgs.runCommand "update-vars-check-${testName}" { @@ -114,16 +122,19 @@ in hostPkgs.bubblewrap ]; closureInfo = hostPkgs.closureInfo { - rootPaths = generatorRuntimeInputs ++ [ - hostPkgs.bash - hostPkgs.coreutils - hostPkgs.jq.dev - hostPkgs.stdenv - hostPkgs.stdenvNoCC - hostPkgs.shellcheck-minimal - hostPkgs.age - hostPkgs.sops - ]; + rootPaths = + generatorRuntimeInputs + ++ allGeneratorScripts + ++ [ + hostPkgs.bash + hostPkgs.coreutils + hostPkgs.jq.dev + hostPkgs.stdenv + hostPkgs.stdenvNoCC + hostPkgs.shellcheck-minimal + hostPkgs.age + hostPkgs.sops + ]; }; } ''