From ec2aee301341a76417e5c25ddb5481b1b30fe32a Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 9 Apr 2025 17:38:06 +0200 Subject: [PATCH] fix(eval/inventory): fix some test arguments to buildInventory --- lib/inventory/distributed-service/inventory-adapter.nix | 2 +- lib/inventory/tests/default.nix | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/inventory/distributed-service/inventory-adapter.nix b/lib/inventory/distributed-service/inventory-adapter.nix index 689e51877..1b442f1f4 100644 --- a/lib/inventory/distributed-service/inventory-adapter.nix +++ b/lib/inventory/distributed-service/inventory-adapter.nix @@ -114,7 +114,7 @@ let inherit (instance) module; inherit resolvedModule instanceRoles; } - ) inventory.instances; + ) inventory.instances or {}; # TODO: Eagerly check the _class of the resolved module importedModulesEvaluated = lib.mapAttrs ( diff --git a/lib/inventory/tests/default.nix b/lib/inventory/tests/default.nix index 55d01df3d..13f75ff67 100644 --- a/lib/inventory/tests/default.nix +++ b/lib/inventory/tests/default.nix @@ -12,6 +12,7 @@ in test_inventory_a = let compiled = buildInventory { + flakeInputs = {}; inventory = { machines = { A = { }; @@ -41,6 +42,7 @@ in test_inventory_empty = let compiled = buildInventory { + flakeInputs = {}; inventory = { }; directory = ./.; }; @@ -53,6 +55,7 @@ in test_inventory_role_resolve = let compiled = buildInventory { + flakeInputs = {}; directory = ./.; inventory = { modules = clan-core.clanModules; @@ -111,6 +114,7 @@ in test_inventory_tag_resolve = let configs = buildInventory { + flakeInputs = {}; directory = ./.; inventory = { modules = clan-core.clanModules; @@ -151,6 +155,7 @@ in test_inventory_multiple_roles = let configs = buildInventory { + flakeInputs = {}; directory = ./.; inventory = { modules = clan-core.clanModules; @@ -177,6 +182,7 @@ in test_inventory_module_doesnt_exist = let configs = buildInventory { + flakeInputs = {}; directory = ./.; inventory = { modules = clan-core.clanModules; @@ -203,6 +209,7 @@ in test_inventory_role_doesnt_exist = let configs = buildInventory { + flakeInputs = {}; directory = ./.; inventory = { modules = clan-core.clanModules; @@ -230,6 +237,7 @@ in test_inventory_tag_doesnt_exist = let configs = buildInventory { + flakeInputs = {}; directory = ./.; inventory = { modules = clan-core.clanModules; @@ -258,6 +266,7 @@ in test_inventory_disabled_service = let configs = buildInventory { + flakeInputs = {}; directory = ./.; inventory = { modules = clan-core.clanModules;