chore(nix): backend tests

This commit is contained in:
Gregor Kleen 2021-09-14 12:09:49 +02:00
parent fd89f34746
commit c3a78c3ef9
2 changed files with 12 additions and 5 deletions

View File

@ -1,9 +1,10 @@
{ pkgs
, prev ? pkgs
, doPortOffset ? true
, doDevelopEnv ? true
}:
with pkgs.lib;
with prev.lib;
let
withDevelop = action: ''
@ -198,7 +199,7 @@ let
${action}
'';
postgresSchema = pkgs.writeText "schema.sql" ''
postgresSchema = prev.writeText "schema.sql" ''
CREATE USER uniworx WITH SUPERUSER;
CREATE DATABASE uniworx_test;
GRANT ALL ON DATABASE uniworx_test TO uniworx;
@ -206,7 +207,7 @@ let
GRANT ALL ON DATABASE uniworx TO uniworx;
'';
postgresHba = pkgs.writeText "hba_file" ''
postgresHba = prev.writeText "hba_file" ''
local all all trust
'';
in withDevelop

View File

@ -72,8 +72,14 @@ in {
build-tools = with final.pkgs; [ llvm_9 final.uniworx.hsPkgs.hspec-discover ];
testWrapper =
let
testWrapper = prev.writeScript "test-wrapper" (import ../develop.nix { inherit pkgs; doDevelopEnv = false; } "$@");
in singleton (toString testWrapper);
testWrapper = prev.writeScript "test-wrapper" (import ../develop.nix { inherit prev; pkgs = final; doDevelopEnv = false; } "$@");
testWrapperWrapped = prev.runCommand "test-wrapper" { buildInputs = [final.makeWrapper]; } ''
makeWrapper ${testWrapper} $out \
--prefix PATH : ${final.postgresql_12}/bin \
--prefix PATH : ${final.minio}/bin \
--prefix PATH : ${final.memcached}/bin
'';
in singleton (toString testWrapperWrapped);
};
components.tests.hlint.build-tools = with final.pkgs; [ llvm_9 final.uniworx.hsPkgs.hlint-test ];
};