buildDotnetModule: set LD_LIBRARY_PATH from runtimeDeps in dotnetCheckHook

Tests should execute in a similar environment to the final app
This commit is contained in:
mdarocha 2022-06-28 22:47:20 +02:00
parent 070314b62d
commit 3d79e4871b
2 changed files with 6 additions and 3 deletions

View file

@ -11,6 +11,9 @@
, buildType
}:
let
libraryPath = lib.makeLibraryPath runtimeDeps;
in
{
dotnetConfigureHook = callPackage ({ }:
makeSetupHook {
@ -35,7 +38,7 @@
name = "dotnet-check-hook";
deps = [ dotnet-test-sdk ];
substitutions = {
inherit buildType;
inherit buildType libraryPath;
disabledTests = lib.optionalString (disabledTests != [])
(lib.concatStringsSep "&FullyQualifiedName!=" disabledTests);
};
@ -56,7 +59,7 @@
deps = [ dotnet-runtime makeWrapper ];
substitutions = {
dotnetRuntime = dotnet-runtime;
runtimeDeps = lib.makeLibraryPath runtimeDeps;
runtimeDeps = libraryPath;
};
} ./dotnet-fixup-hook.sh) { };
}

View file

@ -11,7 +11,7 @@ dotnetCheckHook() {
fi
for project in ${testProjectFile[@]}; do
env \
env "LD_LIBRARY_PATH=@libraryPath@" \
dotnet test "$project" \
-maxcpucount:$maxCpuFlag \
-p:ContinuousIntegrationBuild=true \