Migrate io-tests from bash to pytest
Authored-by: monacoremo <monacoremo>
This commit is contained in:
+14
-3
@@ -15,6 +15,7 @@
|
||||
, postgrestStatic
|
||||
, postgrestProfiled
|
||||
, procps
|
||||
, python3
|
||||
, runtimeShell
|
||||
}:
|
||||
let
|
||||
@@ -74,19 +75,29 @@ let
|
||||
checkedShellScript "postgrest-test-spec-all"
|
||||
(lib.concatStringsSep "\n" testRunners);
|
||||
|
||||
ioTestPython =
|
||||
python3.withPackages (ps: [
|
||||
ps.pytest
|
||||
ps.requests
|
||||
ps.requests-unixsocket
|
||||
ps.pyjwt
|
||||
ps.pyyaml
|
||||
]);
|
||||
|
||||
testIO =
|
||||
name: postgresql:
|
||||
checkedShellScript
|
||||
name
|
||||
''
|
||||
env="$(cat ${postgrest.env})"
|
||||
export PATH="$env/bin:${curl}/bin:${procps}/bin:${diffutils}/bin:$PATH"
|
||||
export PATH="$env/bin:$PATH"
|
||||
|
||||
rootdir="$(${git}/bin/git rev-parse --show-toplevel)"
|
||||
cd "$rootdir"
|
||||
|
||||
${cabal-install}/bin/cabal v2-build ${devCabalOptions}
|
||||
${cabal-install}/bin/cabal v2-exec ${withTmpDb postgresql} "$rootdir"/test/io-tests.sh
|
||||
${cabal-install}/bin/cabal v2-exec ${withTmpDb postgresql} \
|
||||
${ioTestPython}/bin/pytest -- -v "$rootdir"/test/io-tests "$@"
|
||||
'';
|
||||
|
||||
testMemory =
|
||||
@@ -117,7 +128,7 @@ buildEnv
|
||||
] ++ testSpecVersions;
|
||||
}
|
||||
# The memory tests have large dependencies (a profiled build of PostgREST)
|
||||
# and are run less often than the spec tests, so we don't include them in
|
||||
# and are run less often than the spec tests, so we don't include them in
|
||||
# the default test environment. We make them available through a separate attribute:
|
||||
// {
|
||||
memoryTests =
|
||||
|
||||
Reference in New Issue
Block a user