about summary refs log tree commit diff
path: root/nixos/tests/n8n.nix
blob: 0a12192d5c71242644f82d0f884a56710a6c2082 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import ./make-test-python.nix ({ 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;
      };
    };

  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")
  '';
})