0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50: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-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; };

View file

@ -1,30 +1,28 @@
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")
'';
}