diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 3c0547d4578c..98fc5731e51f 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1208,6 +1208,7 @@ in paperless = runTest ./paperless.nix; paretosecurity = runTest ./paretosecurity.nix; parsedmarc = handleTest ./parsedmarc { }; + part-db = runTest ./web-apps/part-db.nix; pass-secret-service = runTest ./pass-secret-service.nix; password-option-override-ordering = runTest ./password-option-override-ordering.nix; patroni = handleTestOn [ "x86_64-linux" ] ./patroni.nix { }; diff --git a/nixos/tests/web-apps/part-db.nix b/nixos/tests/web-apps/part-db.nix new file mode 100644 index 000000000000..66e43b09a50e --- /dev/null +++ b/nixos/tests/web-apps/part-db.nix @@ -0,0 +1,22 @@ +{ lib, ... }: +{ + name = "part-db"; + meta.maintainers = with lib.maintainers; [ oddlama ]; + + nodes = { + machine = { + services.part-db.enable = true; + }; + }; + + testScript = '' + start_all() + machine.wait_for_unit("postgresql.service") + machine.wait_for_unit("part-db-migrate.service") + machine.wait_for_unit("phpfpm-part-db.service") + machine.wait_for_unit("nginx.service") + machine.wait_for_open_port(80) + + machine.succeed("curl -L --fail http://localhost | grep 'Part-DB'", timeout=10) + ''; +} diff --git a/pkgs/by-name/pa/part-db/package.nix b/pkgs/by-name/pa/part-db/package.nix index ca8c2baf1a53..0e6cfe954c3b 100644 --- a/pkgs/by-name/pa/part-db/package.nix +++ b/pkgs/by-name/pa/part-db/package.nix @@ -7,6 +7,7 @@ nodejs, yarnConfigHook, yarnBuildHook, + nixosTests, envLocalPath ? "/var/lib/part-db/env.local", cachePath ? "/var/cache/part-db/", logPath ? "/var/log/part-db/", @@ -84,6 +85,8 @@ stdenv.mkDerivation (finalAttrs: { ln -s ${cachePath} $out/var/cache ''; + passthru.tests = { inherit (nixosTests) part-db; }; + meta = { description = "Open source inventory management system for your electronic components"; homepage = "https://docs.part-db.de/";