nixosTests.n8n: migrate to runTest (#394932)

Changed files
+26 -28
nixos
+1 -1
nixos/tests/all-tests.nix
···
mysql-autobackup = handleTest ./mysql/mysql-autobackup.nix {};
mysql-backup = handleTest ./mysql/mysql-backup.nix {};
mysql-replication = handleTest ./mysql/mysql-replication.nix {};
-
n8n = handleTest ./n8n.nix {};
+
n8n = runTest ./n8n.nix;
nagios = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./nagios.nix {};
nar-serve = handleTest ./nar-serve.nix {};
nat.firewall = handleTest ./nat.nix { withFirewall = true; };
+25 -27
nixos/tests/n8n.nix
···
-
import ./make-test-python.nix (
-
{ lib, ... }:
-
let
-
port = 5678;
-
webhookUrl = "http://example.com";
-
in
-
{
-
name = "n8n";
-
meta.maintainers = with lib.maintainers; [
-
freezeboy
-
k900
-
];
+
{ lib, ... }:
+
let
+
port = 5678;
+
webhookUrl = "http://example.com";
+
in
+
{
+
name = "n8n";
+
meta.maintainers = with lib.maintainers; [
+
freezeboy
+
k900
+
];
-
nodes.machine =
-
{ pkgs, ... }:
-
{
-
services.n8n = {
-
enable = true;
-
webhookUrl = webhookUrl;
-
};
+
nodes.machine =
+
{ pkgs, ... }:
+
{
+
services.n8n = {
+
enable = true;
+
webhookUrl = webhookUrl;
};
+
};
-
testScript = ''
-
machine.wait_for_unit("n8n.service")
-
machine.wait_for_console_text("Editor is now accessible via")
-
machine.succeed("curl --fail -vvv http://localhost:${toString port}/")
-
machine.succeed("grep -qF ${webhookUrl} /etc/systemd/system/n8n.service")
-
'';
-
}
-
)
+
testScript = ''
+
machine.wait_for_unit("n8n.service")
+
machine.wait_for_console_text("Editor is now accessible via")
+
machine.succeed("curl --fail -vvv http://localhost:${toString port}/")
+
machine.succeed("grep -qF ${webhookUrl} /etc/systemd/system/n8n.service")
+
'';
+
}