Fix test function to work with Nixpkgs 23.05

This commit is contained in:
Sander van der Burg 2023-09-20 18:36:07 +02:00
parent cc90d87001
commit 0e9ec77cc6
5 changed files with 12 additions and 5 deletions

View File

@ -11,7 +11,7 @@ let
inherit pkgs system;
};
testSystemVariantForProcessManager = {processManager, profileSettings, exprFile, extraParams ? {}, nixosConfig ? null, systemPackages ? [], initialTests ? null, readiness ? null, tests ? null, postTests ? null}:
testSystemVariantForProcessManager = {name, processManager, profileSettings, exprFile, extraParams ? {}, nixosConfig ? null, systemPackages ? [], initialTests ? null, readiness ? null, tests ? null, postTests ? null}:
let
processManagerModule = builtins.getAttr processManager processManagerModules;
@ -31,7 +31,9 @@ let
with import "${nixpkgs}/nixos/lib/testing-python.nix" { inherit system; };
makeTest {
machine =
inherit name;
nodes.machine =
{pkgs, lib, ...}:
{
@ -77,13 +79,14 @@ let
let
instance = builtins.getAttr instanceName processes;
in
tests ({ inherit instanceName instance; } // processManagerSettings.params)
tests ({ inherit instanceName instance processManager; } // processManagerSettings.params)
) (builtins.attrNames processes))
+ pkgs.lib.optionalString (postTests != null) (postTests (processManagerSettings.params // { inherit processes; }));
};
in
{ processManagers
{ name
, processManagers
, profiles
, exprFile
, extraParams ? {}
@ -102,7 +105,7 @@ pkgs.lib.genAttrs profiles (profile:
in
pkgs.lib.genAttrs processManagers (processManager:
testSystemVariantForProcessManager {
inherit processManager profileSettings exprFile extraParams nixosConfig systemPackages initialTests readiness tests postTests;
inherit name processManager profileSettings exprFile extraParams nixosConfig systemPackages initialTests readiness tests postTests;
}
)
)

View File

@ -1,6 +1,7 @@
{ pkgs, testService, processManagers, profiles }:
testService {
name = "docker";
exprFile = ./processes.nix;
systemPackages = [ pkgs.docker ];

View File

@ -1,6 +1,7 @@
{ pkgs, testService, processManagers, profiles }:
testService {
name = "nginx-reverse-proxy-hostbased";
exprFile = ./processes.nix;
readiness = {instanceName, instance, ...}:

View File

@ -41,6 +41,7 @@ let
};
in
testService {
name = "s6-svscan";
exprFile = ./processes.nix;
systemPackages = [ pkgs.s6-rc ];

View File

@ -26,6 +26,7 @@ let
};
in
testService {
name = "supervisord";
exprFile = ./processes.nix;
systemPackages = [ pkgs.python3Packages.supervisor ];