summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-07-11 06:31:02 +0200
committerRory& <root@rory.gay>2026-07-11 06:31:02 +0200
commit252f1510dbc562c4120bf20f0b0cbf9d4ef14b05 (patch)
treecf19aebb0839e1c9564d34746b9031b82f1729e0
parentSystemd notify hooks, move nixos integration tests to a systemd service (diff)
downloadserver-ts-252f1510dbc562c4120bf20f0b0cbf9d4ef14b05.tar.xz
Working unit failure detection
-rw-r--r--nix/tests/test-bundle-starts.nix13
1 files changed, 5 insertions, 8 deletions
diff --git a/nix/tests/test-bundle-starts.nix b/nix/tests/test-bundle-starts.nix

index b2be0bb8..6ae19c13 100644 --- a/nix/tests/test-bundle-starts.nix +++ b/nix/tests/test-bundle-starts.nix
@@ -74,7 +74,7 @@ in # ...fix startup ordering systemd.services = let - services = [ "postgresql.service" ] ++ lib.optional (isRabbitMqTest) [ "rabbitmq.service" ]; + services = [ "postgresql.service" ] ++ lib.optional (isRabbitMqTest) "rabbitmq.service"; serviceDef = { after = services; wants = services; @@ -101,10 +101,7 @@ in serviceConfig = { ExecStart = "${testBin} -reporter verbose -parallelAlgorithm aggressive -maxThreads unlimited -preEnumerateTheories"; DynamicUser = true; - RestrictSUIDSGID = true; - Restart = "no"; - UMask = "077"; }; }; }; @@ -154,9 +151,9 @@ in machine.succeed("curl -f http://cdn.sb.localhost/metrics") machine.wait_for_unit("spacebar-tests") - machine.wait_until_fails("systemctl show spacebar-tests.service | grep 'SubState=running' -q") - # run integration tests - # machine.succeed("/usr/bin/env TEST_APPSETTINGS_PATH=${testConfigPath} ${testBin} -reporter verbose -parallelAlgorithm aggressive -maxThreads unlimited -preEnumerateTheories") - + machine.wait_until_fails("systemctl show spacebar-tests.service | grep 'SubState=running' -q") # ... wait for the unit to exit in any way + + testUnitState = machine.get_unit_property("spacebar-tests.service", "SubState"); + t.assertNotEqual("failed", testUnitState) ''; }