nix: avoid rebuilding memory tests when entering nix-shell

The memory tests are now run in the same way as the regular tests.
This commit is contained in:
Wolfgang Walther
2025-03-30 18:57:39 +00:00
parent 001835eddc
commit 95e36fdad9
8 changed files with 60 additions and 68 deletions
+19 -1
View File
@@ -1,6 +1,7 @@
{ buildToolbox
, cabal-install
, checkedShellScript
, curl
, devCabalOptions
, ghc
, glibcLocales ? null
@@ -235,6 +236,22 @@ let
sed -i 's|^module \(.*\):|module \1/|g' test/coverage.overlay
'';
testMemory =
checkedShellScript
{
name = "postgrest-test-memory";
docs = "Run the memory tests.";
workingDir = "/";
withEnv = postgrest.env;
withPath = [ curl ];
}
''
${cabal-install}/bin/cabal v2-update
${cabal-install}/bin/cabal --builddir="dist-prof" v2-build --enable-profiling --disable-shared exe:postgrest
${cabal-install}/bin/cabal --builddir="dist-prof" v2-exec -- ${withTools.withPg} -f test/spec/fixtures/load.sql \
test/memory/memory-tests.sh
'';
in
buildToolbox
{
@@ -249,6 +266,7 @@ buildToolbox
testReplica
dumpSchema
coverage
coverageDraftOverlay;
coverageDraftOverlay
testMemory;
};
}