From 58558fec0bbccdf8c9c5124d3cdbcfa5305c9850 Mon Sep 17 00:00:00 2001 From: cinereal Date: Sat, 25 Jul 2026 21:15:30 +0200 Subject: [PATCH] lib/services: fix test expectations for the reload options `process` gained `reloadCommand` and `reloadSignal`, and every service now carries an assertion guarding their combination, so the expected values in `test.nix` no longer matched. Compare only `process.argv` and only the assertions that are violated, so the test keeps expressing what it is about rather than restating every option. Assisted-by: Claude:claude-opus-5 --- lib/services/test.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/services/test.nix b/lib/services/test.nix index 65d05ceb39e9..767a954f675f 100644 --- a/lib/services/test.nix +++ b/lib/services/test.nix @@ -91,10 +91,16 @@ let ]; }; + # Every service carries some assertions that hold; only the violated ones are of interest here. + failures = lib.filter (a: !a.assertion); + filterEval = config: lib.optionalAttrs (config ? process) { - inherit (config) assertions warnings process; + inherit (config) warnings; + assertions = failures config.assertions; + # Only `argv` is relevant here; `process` also carries the reload options. + process = { inherit (config.process) argv; }; } // { services = lib.mapAttrs (k: filterEval) config.services; @@ -165,7 +171,7 @@ let ]; assert - portable-lib.getAssertions [ "service1" ] exampleEval.config.services.service1 == [ + failures (portable-lib.getAssertions [ "service1" ] exampleEval.config.services.service1) == [ { message = "in service1: you can't enable this for that reason"; assertion = false; @@ -177,7 +183,7 @@ let "in service3.services.exclacow: The `bar' service is deprecated and will go away soon!" ]; assert - portable-lib.getAssertions [ "service3" ] exampleEval.config.services.service3 == [ + failures (portable-lib.getAssertions [ "service3" ] exampleEval.config.services.service3) == [ { message = "in service3.services.exclacow: you can't enable this for such reason"; assertion = false;