0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

nixosTests.n8n: migrate to runTest (#394932)

This commit is contained in:
Gaétan Lepage 2025-04-01 12:09:01 +02:00 committed by GitHub
commit 08dc9736a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 28 deletions

View file

@ -756,7 +756,7 @@ in {
mysql-autobackup = handleTest ./mysql/mysql-autobackup.nix {}; mysql-autobackup = handleTest ./mysql/mysql-autobackup.nix {};
mysql-backup = handleTest ./mysql/mysql-backup.nix {}; mysql-backup = handleTest ./mysql/mysql-backup.nix {};
mysql-replication = handleTest ./mysql/mysql-replication.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 {}; nagios = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./nagios.nix {};
nar-serve = handleTest ./nar-serve.nix {}; nar-serve = handleTest ./nar-serve.nix {};
nat.firewall = handleTest ./nat.nix { withFirewall = true; }; nat.firewall = handleTest ./nat.nix { withFirewall = true; };

View file

@ -1,30 +1,28 @@
import ./make-test-python.nix ( { lib, ... }:
{ lib, ... }: let
let port = 5678;
port = 5678; webhookUrl = "http://example.com";
webhookUrl = "http://example.com"; in
in {
{ name = "n8n";
name = "n8n"; meta.maintainers = with lib.maintainers; [
meta.maintainers = with lib.maintainers; [ freezeboy
freezeboy k900
k900 ];
];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:
{ {
services.n8n = { services.n8n = {
enable = true; enable = true;
webhookUrl = webhookUrl; webhookUrl = webhookUrl;
};
}; };
};
testScript = '' testScript = ''
machine.wait_for_unit("n8n.service") machine.wait_for_unit("n8n.service")
machine.wait_for_console_text("Editor is now accessible via") machine.wait_for_console_text("Editor is now accessible via")
machine.succeed("curl --fail -vvv http://localhost:${toString port}/") machine.succeed("curl --fail -vvv http://localhost:${toString port}/")
machine.succeed("grep -qF ${webhookUrl} /etc/systemd/system/n8n.service") machine.succeed("grep -qF ${webhookUrl} /etc/systemd/system/n8n.service")
''; '';
} }
)