nix(refactor): Move name arguments into scripts and use global postgresql in tests.nix

This commit is contained in:
Wolfgang Walther
2021-04-18 13:51:39 +02:00
committed by Wolfgang Walther
parent 915d568257
commit dccce946e3
+16 -25
View File
@@ -41,7 +41,6 @@ let
# Helper script for running a command against all PostgreSQL versions. # Helper script for running a command against all PostgreSQL versions.
withAllVersions = withAllVersions =
name:
let let
runners = runners =
builtins.map builtins.map
@@ -69,7 +68,7 @@ let
in in
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-with-all";
docs = "Run command against all supported PostgreSQL versions."; docs = "Run command against all supported PostgreSQL versions.";
inRootDir = true; inRootDir = true;
} }
@@ -77,10 +76,9 @@ let
# Script to run the Haskell test suite # Script to run the Haskell test suite
testSpec = testSpec =
name: postgresql:
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-test-spec";
docs = "Run the Haskell test suite"; docs = "Run the Haskell test suite";
inRootDir = true; inRootDir = true;
} }
@@ -92,10 +90,9 @@ let
''; '';
testSpecIdempotence = testSpecIdempotence =
name: postgrestql:
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-test-spec-idempotence";
docs = "Check that the Haskell tests can be run multiple times against the same db."; docs = "Check that the Haskell tests can be run multiple times against the same db.";
inRootDir = true; inRootDir = true;
} }
@@ -119,10 +116,9 @@ let
]); ]);
testIO = testIO =
name: postgresql:
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-test-io";
docs = "Run the pytest-based IO tests."; docs = "Run the pytest-based IO tests.";
inRootDir = true; inRootDir = true;
} }
@@ -136,10 +132,9 @@ let
''; '';
testMemory = testMemory =
name: postgresql:
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-test-memory";
docs = "Run the memory tests."; docs = "Run the memory tests.";
inRootDir = true; inRootDir = true;
} }
@@ -150,10 +145,9 @@ let
''; '';
dumpSchema = dumpSchema =
name: postgresql:
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-dump-schema";
docs = "Dump the loaded schema's DbStructure as a yaml file."; docs = "Dump the loaded schema's DbStructure as a yaml file.";
inRootDir = true; inRootDir = true;
} }
@@ -168,10 +162,9 @@ let
''; '';
coverage = coverage =
name: postgresql:
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-coverage";
docs = "Run spec and io tests while collecting hpc coverage data."; docs = "Run spec and io tests while collecting hpc coverage data.";
inRootDir = true; inRootDir = true;
redirectTixFiles = false; redirectTixFiles = false;
@@ -231,10 +224,9 @@ let
''; '';
coverageDraftOverlay = coverageDraftOverlay =
name:
checkedShellScript checkedShellScript
{ {
inherit name; name = "postgrest-coverage-draft-overlay";
docs = "Create a draft overlay from current coverage report."; docs = "Create a draft overlay from current coverage report.";
inRootDir = true; inRootDir = true;
} }
@@ -253,19 +245,18 @@ buildEnv
paths = paths =
[ [
(testSpec "postgrest-test-spec" postgresql).bin testSpec.bin
(testSpecIdempotence "postgrest-test-spec-idempotence" postgresql).bin testSpecIdempotence.bin
(testIO "postgrest-test-io" postgresql).bin testIO.bin
(dumpSchema "postgrest-dump-schema" postgresql).bin dumpSchema.bin
(coverage "postgrest-coverage" postgresql).bin coverage.bin
(coverageDraftOverlay "postgrest-coverage-draft-overlay").bin coverageDraftOverlay.bin
(withAllVersions "postgrest-with-all").bin withAllVersions.bin
] ++ withPostgresqlVersions; ] ++ withPostgresqlVersions;
} }
# The memory tests have large dependencies (a profiled build of PostgREST) # 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: # the default test environment. We make them available through a separate attribute:
// { // {
memoryTests = memoryTests = testMemory.bin;
(testMemory "postgrest-test-memory" postgresql).bin;
} }