fix(checks/data-mesher): format, dont pass a duplicate data-mesher module

This commit is contained in:
Johannes Kirschbauer
2025-04-09 18:03:04 +02:00
parent ec2aee3013
commit c344d57298
8 changed files with 32 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
(import ../lib/test-inventory.nix) ( (import ../lib/test-inventory.nix) (
{ self, lib, ... }: { lib, ... }:
let let
machines = [ machines = [
@@ -21,9 +21,6 @@
roles.signer.machines = [ "signer" ]; roles.signer.machines = [ "signer" ];
}; };
}; };
modules = {
data-mesher = self.clanModules.data-mesher;
};
}; };
directory = ./.; directory = ./.;
}; };

View File

@@ -18,7 +18,7 @@
}; };
}; };
instances."test" = { instances."test" = {
module.name = "new-service"; module.name = "new-service";
roles.peer.machines.peer1 = { }; roles.peer.machines.peer1 = { };
}; };
@@ -27,7 +27,7 @@
new-service = { new-service = {
_class = "clan.service"; _class = "clan.service";
manifest.name = "new-service"; manifest.name = "new-service";
roles.peer = {}; roles.peer = { };
perMachine = { perMachine = {
nixosModule = { nixosModule = {
# This should be generated by: # This should be generated by:
@@ -48,16 +48,18 @@
}; };
}; };
testScript = { nodes, ...}: '' testScript =
start_all() { nodes, ... }:
admin1.wait_for_unit("multi-user.target") ''
peer1.wait_for_unit("multi-user.target") start_all()
# Provided by the legacy module admin1.wait_for_unit("multi-user.target")
print(admin1.succeed("systemctl status dummy-service")) peer1.wait_for_unit("multi-user.target")
print(peer1.succeed("systemctl status dummy-service")) # Provided by the legacy module
print(admin1.succeed("systemctl status dummy-service"))
print(peer1.succeed("systemctl status dummy-service"))
# peer1 should have the 'hello' file # peer1 should have the 'hello' file
peer1.succeed("cat ${nodes.peer1.clan.core.vars.generators.new-service.files.hello.path}") peer1.succeed("cat ${nodes.peer1.clan.core.vars.generators.new-service.files.hello.path}")
''; '';
} }
) )

View File

@@ -3,4 +3,4 @@
"publickey": "age1hd2exjq88h7538y6mvjvexx3u5gp6a03yfn5nj32h2667yyksyaqcuk5qs", "publickey": "age1hd2exjq88h7538y6mvjvexx3u5gp6a03yfn5nj32h2667yyksyaqcuk5qs",
"type": "age" "type": "age"
} }
] ]

View File

@@ -3,4 +3,4 @@
"publickey": "age19urkt89q45a2wk6a4yaramzufjtnw6nq2snls0v7hmf7tqf73axsfx50tk", "publickey": "age19urkt89q45a2wk6a4yaramzufjtnw6nq2snls0v7hmf7tqf73axsfx50tk",
"type": "age" "type": "age"
} }
] ]

View File

@@ -1 +1,4 @@
{"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg", "type": "age"} {
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"type": "age"
}

View File

@@ -28,7 +28,7 @@ let
inherit (config) inventory; inherit (config) inventory;
inherit flakeInputs; inherit flakeInputs;
}; };
machines = lib.mapAttrs (machineName: v: { machines = lib.mapAttrs (_machineName: v: {
machineImports = v; machineImports = v;
}) config.distributedServices.allMachines; }) config.distributedServices.allMachines;
} }

View File

@@ -114,7 +114,7 @@ let
inherit (instance) module; inherit (instance) module;
inherit resolvedModule instanceRoles; inherit resolvedModule instanceRoles;
} }
) inventory.instances or {}; ) inventory.instances or { };
# TODO: Eagerly check the _class of the resolved module # TODO: Eagerly check the _class of the resolved module
importedModulesEvaluated = lib.mapAttrs ( importedModulesEvaluated = lib.mapAttrs (

View File

@@ -12,7 +12,7 @@ in
test_inventory_a = test_inventory_a =
let let
compiled = buildInventory { compiled = buildInventory {
flakeInputs = {}; flakeInputs = { };
inventory = { inventory = {
machines = { machines = {
A = { }; A = { };
@@ -42,7 +42,7 @@ in
test_inventory_empty = test_inventory_empty =
let let
compiled = buildInventory { compiled = buildInventory {
flakeInputs = {}; flakeInputs = { };
inventory = { }; inventory = { };
directory = ./.; directory = ./.;
}; };
@@ -55,7 +55,7 @@ in
test_inventory_role_resolve = test_inventory_role_resolve =
let let
compiled = buildInventory { compiled = buildInventory {
flakeInputs = {}; flakeInputs = { };
directory = ./.; directory = ./.;
inventory = { inventory = {
modules = clan-core.clanModules; modules = clan-core.clanModules;
@@ -114,7 +114,7 @@ in
test_inventory_tag_resolve = test_inventory_tag_resolve =
let let
configs = buildInventory { configs = buildInventory {
flakeInputs = {}; flakeInputs = { };
directory = ./.; directory = ./.;
inventory = { inventory = {
modules = clan-core.clanModules; modules = clan-core.clanModules;
@@ -155,7 +155,7 @@ in
test_inventory_multiple_roles = test_inventory_multiple_roles =
let let
configs = buildInventory { configs = buildInventory {
flakeInputs = {}; flakeInputs = { };
directory = ./.; directory = ./.;
inventory = { inventory = {
modules = clan-core.clanModules; modules = clan-core.clanModules;
@@ -182,7 +182,7 @@ in
test_inventory_module_doesnt_exist = test_inventory_module_doesnt_exist =
let let
configs = buildInventory { configs = buildInventory {
flakeInputs = {}; flakeInputs = { };
directory = ./.; directory = ./.;
inventory = { inventory = {
modules = clan-core.clanModules; modules = clan-core.clanModules;
@@ -209,7 +209,7 @@ in
test_inventory_role_doesnt_exist = test_inventory_role_doesnt_exist =
let let
configs = buildInventory { configs = buildInventory {
flakeInputs = {}; flakeInputs = { };
directory = ./.; directory = ./.;
inventory = { inventory = {
modules = clan-core.clanModules; modules = clan-core.clanModules;
@@ -237,7 +237,7 @@ in
test_inventory_tag_doesnt_exist = test_inventory_tag_doesnt_exist =
let let
configs = buildInventory { configs = buildInventory {
flakeInputs = {}; flakeInputs = { };
directory = ./.; directory = ./.;
inventory = { inventory = {
modules = clan-core.clanModules; modules = clan-core.clanModules;
@@ -266,7 +266,7 @@ in
test_inventory_disabled_service = test_inventory_disabled_service =
let let
configs = buildInventory { configs = buildInventory {
flakeInputs = {}; flakeInputs = { };
directory = ./.; directory = ./.;
inventory = { inventory = {
modules = clan-core.clanModules; modules = clan-core.clanModules;