nix: properly throw away tix files for postgrest-watch, resolves #1807
This commit is contained in:
committed by
Wolfgang Walther
parent
fc791a6320
commit
67ca814d0b
@@ -23,6 +23,7 @@ let
|
|||||||
postgrest-watch postgrest-test-io
|
postgrest-watch postgrest-test-io
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
redirectTixFiles = false; # will be done by sub-command
|
||||||
inRootDir = true;
|
inRootDir = true;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
, stdenv
|
, stdenv
|
||||||
, writeTextFile
|
, writeTextFile
|
||||||
}:
|
}:
|
||||||
{ name, docs, inRootDir ? false, withTmpDir ? false }: text:
|
{ name, docs, inRootDir ? false, redirectTixFiles ? true, withTmpDir ? false }: text:
|
||||||
# TODO: do something sensible with docs, e.g. provide automated --help
|
# TODO: do something sensible with docs, e.g. provide automated --help
|
||||||
let
|
let
|
||||||
bin =
|
bin =
|
||||||
@@ -22,14 +22,12 @@ let
|
|||||||
''
|
''
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
''
|
||||||
# make sure that no script creates conflicting tix files
|
+ lib.optionalString redirectTixFiles ''
|
||||||
# postgrest-coverage will override HPCTIXFILE to make proper use of it
|
# storing tix files in a temporary throw away directory avoids mix/tix conflicts after changes
|
||||||
if test ! -v HPCTIXFILE; then
|
hpctixdir=$(mktemp -d)
|
||||||
hpctixdir=$(mktemp -d)
|
export HPCTIXFILE="$hpctixdir"/postgrest.tix
|
||||||
export HPCTIXFILE="$hpctixdir"/postgrest.tix
|
trap 'rm -rf $hpctixdir' EXIT
|
||||||
trap 'rm -rf $hpctixdir' EXIT
|
|
||||||
fi
|
|
||||||
''
|
''
|
||||||
+ lib.optionalString inRootDir ''
|
+ lib.optionalString inRootDir ''
|
||||||
cd "$(${git}/bin/git rev-parse --show-toplevel)"
|
cd "$(${git}/bin/git rev-parse --show-toplevel)"
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ let
|
|||||||
inherit name;
|
inherit name;
|
||||||
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;
|
||||||
withTmpDir = true;
|
withTmpDir = true;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ checkedShellScript
|
|||||||
name = "postgrest-test-withtmpdb-${postgresql.name}";
|
name = "postgrest-test-withtmpdb-${postgresql.name}";
|
||||||
docs = "Run the given command in a temporary database";
|
docs = "Run the given command in a temporary database";
|
||||||
inRootDir = true;
|
inRootDir = true;
|
||||||
|
redirectTixFiles = false;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
# avoid starting multiple layers of with_tmp_db
|
# avoid starting multiple layers of with_tmp_db
|
||||||
|
|||||||
Reference in New Issue
Block a user