about summary refs log tree commit diff
path: root/nixos/tests/crabfit.nix
blob: 0cd0741f6fa4b54d67d996210589d8c8d316afd0 (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
26
27
28
29
30
31
32
33
import ./make-test-python.nix (
  { lib, pkgs, ... }:

  {
    name = "crabfit";

    meta.maintainers = with lib.maintainers; [ thubrecht ];

    nodes = {
      machine =
        { pkgs, ... }:
        {
          services.crabfit = {
            enable = true;

            frontend.host = "http://127.0.0.1:3001";
            api.host = "127.0.0.1:3000";
          };
        };
    };

    # TODO: Add a reverse proxy and a dns entry for testing
    testScript = ''
      machine.wait_for_unit("crabfit-api")
      machine.wait_for_unit("crabfit-frontend")

      machine.wait_for_open_port(3000)
      machine.wait_for_open_port(3001)

      machine.succeed("curl -f http://localhost:3001/")
    '';
  }
)