From 113a6f9fe6603be7488c1c9a5bb4b1b7c5bb2f71 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 19 May 2024 01:27:56 +0300 Subject: Move NixOS test initialization to the package This allows to initialize tests easier and not have them depend on the flake itself. This might be useful if I ever have to build this package without a flake. --- kittybox.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'kittybox.nix') diff --git a/kittybox.nix b/kittybox.nix index 1d66fc7..eea7006 100644 --- a/kittybox.nix +++ b/kittybox.nix @@ -1,7 +1,7 @@ { stdenv, lib, naersk, lld, mold, typescript , useWebAuthn ? false, openssl, zlib, pkg-config, protobuf , usePostgres ? true, postgresql, postgresqlTestHook -, nixosTests }: +, nixosTest }: assert useWebAuthn -> openssl != null && pkg-config != null; assert usePostgres -> postgresql != null && postgresqlTestHook != null; @@ -36,7 +36,14 @@ naersk.buildPackage rec { ''; passthru = { - tests = nixosTests; + tests = { + distributed = nixosTest ./nixos-tests/distributed-test.nix; + smokeTest = nixosTest ./nixos-tests/smoke-test.nix; + } // (lib.optionalAttrs usePostgres { + webmention = nixosTest ./nixos-tests/webmention-test.nix; + postgresSmokeTest = nixosTest ./nixos-tests/postgres-smoke-test.nix; + }); + hasPostgres = usePostgres; }; -- cgit 1.4.1