nix: remove uneeded slocat
slocat was introduced to test pipeline mode (see https://github.com/PostgREST/postgrest/pull/2682), but pipeline mode was not merged https://github.com/PostgREST/postgrest/pull/2707. So it's really not needed on the loadtests.
This commit is contained in:
committed by
Wolfgang Walther
parent
5ff271592c
commit
af4c4157f5
@@ -44,7 +44,6 @@ let
|
|||||||
allOverlays.checked-shell-script
|
allOverlays.checked-shell-script
|
||||||
allOverlays.gitignore
|
allOverlays.gitignore
|
||||||
(allOverlays.haskell-packages { inherit compiler; })
|
(allOverlays.haskell-packages { inherit compiler; })
|
||||||
allOverlays.slocat
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Evaluated expression of the Nixpkgs repository.
|
# Evaluated expression of the Nixpkgs repository.
|
||||||
|
|||||||
@@ -3,5 +3,4 @@
|
|||||||
checked-shell-script = import ./checked-shell-script;
|
checked-shell-script = import ./checked-shell-script;
|
||||||
gitignore = import ./gitignore.nix;
|
gitignore = import ./gitignore.nix;
|
||||||
haskell-packages = import ./haskell-packages.nix;
|
haskell-packages = import ./haskell-packages.nix;
|
||||||
slocat = import ./slocat.nix;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
_: prev:
|
|
||||||
{
|
|
||||||
slocat = prev.buildGoModule {
|
|
||||||
name = "slocat";
|
|
||||||
src = prev.fetchFromGitHub {
|
|
||||||
owner = "robx";
|
|
||||||
repo = "slocat";
|
|
||||||
rev = "52e7512c6029fd00483e41ccce260a3b4b9b3b64";
|
|
||||||
sha256 = "sha256-qn6luuh5wqREu3s8RfuMCP5PKdS2WdwPrujRYTpfzQ8=";
|
|
||||||
};
|
|
||||||
vendorHash = null;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -140,9 +140,7 @@ let
|
|||||||
mixed)
|
mixed)
|
||||||
# shellcheck disable=SC2145
|
# shellcheck disable=SC2145
|
||||||
${withTools.withPg} -f "$_arg_testdir"/fixtures.sql \
|
${withTools.withPg} -f "$_arg_testdir"/fixtures.sql \
|
||||||
${withTools.withSlowPg} \
|
|
||||||
${withTools.withPgrst} -m "$_arg_monitor" \
|
${withTools.withPgrst} -m "$_arg_monitor" \
|
||||||
${withTools.withSlowPgrst} \
|
|
||||||
sh -c "cd \"$_arg_testdir\" && \
|
sh -c "cd \"$_arg_testdir\" && \
|
||||||
${runner} -targets targets.http -output \"$abs_output\" \"''${_arg_leftovers[@]}\""
|
${runner} -targets targets.http -output \"$abs_output\" \"''${_arg_leftovers[@]}\""
|
||||||
;;
|
;;
|
||||||
|
|||||||
+1
-79
@@ -6,7 +6,6 @@
|
|||||||
, postgresqlVersions
|
, postgresqlVersions
|
||||||
, postgrest
|
, postgrest
|
||||||
, python3Packages
|
, python3Packages
|
||||||
, slocat
|
|
||||||
, writeText
|
, writeText
|
||||||
, writers
|
, writers
|
||||||
}:
|
}:
|
||||||
@@ -185,81 +184,6 @@ let
|
|||||||
|
|
||||||
withPg = withTmpDb (builtins.head postgresqlVersions);
|
withPg = withTmpDb (builtins.head postgresqlVersions);
|
||||||
|
|
||||||
withSlowPg =
|
|
||||||
checkedShellScript
|
|
||||||
{
|
|
||||||
name = "postgrest-with-slow-pg";
|
|
||||||
docs = "Run the given command with simulated high latency postgresql";
|
|
||||||
args =
|
|
||||||
[
|
|
||||||
"ARG_POSITIONAL_SINGLE([command], [Command to run])"
|
|
||||||
"ARG_LEFTOVERS([command arguments])"
|
|
||||||
"ARG_USE_ENV([PGHOST], [], [PG host (socket name)])"
|
|
||||||
"ARG_USE_ENV([PGDELAY], [0ms], [extra PG latency (duration)])"
|
|
||||||
];
|
|
||||||
positionalCompletion = "_command";
|
|
||||||
workingDir = "/";
|
|
||||||
redirectTixFiles = false;
|
|
||||||
withTmpDir = true;
|
|
||||||
}
|
|
||||||
''
|
|
||||||
delay="''${PGDELAY:-0ms}"
|
|
||||||
echo "delaying data to/from postgres by $delay"
|
|
||||||
|
|
||||||
REALPGHOST="$PGHOST"
|
|
||||||
export PGHOST="$tmpdir/socket"
|
|
||||||
mkdir -p "$PGHOST"
|
|
||||||
|
|
||||||
${slocat}/bin/slocat -delay "$delay" -src "$PGHOST/.s.PGSQL.5432" -dst "$REALPGHOST/.s.PGSQL.5432" &
|
|
||||||
SLOCAT_PID=$!
|
|
||||||
# shellcheck disable=SC2317
|
|
||||||
stop_slocat() {
|
|
||||||
kill "$SLOCAT_PID" || true
|
|
||||||
wait "$SLOCAT_PID" || true
|
|
||||||
}
|
|
||||||
trap stop_slocat EXIT
|
|
||||||
sleep 1 # should wait for socket file to appear instead
|
|
||||||
|
|
||||||
("$_arg_command" "''${_arg_leftovers[@]}")
|
|
||||||
'';
|
|
||||||
|
|
||||||
withSlowPgrst =
|
|
||||||
checkedShellScript
|
|
||||||
{
|
|
||||||
name = "postgrest-with-slow-postgrest";
|
|
||||||
docs = "Run the given command with simulated high latency postgrest";
|
|
||||||
args =
|
|
||||||
[
|
|
||||||
"ARG_POSITIONAL_SINGLE([command], [Command to run])"
|
|
||||||
"ARG_LEFTOVERS([command arguments])"
|
|
||||||
"ARG_USE_ENV([PGRST_SERVER_UNIX_SOCKET], [], [PostgREST host (socket name)])"
|
|
||||||
"ARG_USE_ENV([PGRST_DELAY], [0ms], [extra PostgREST latency (duration)])"
|
|
||||||
];
|
|
||||||
positionalCompletion = "_command";
|
|
||||||
workingDir = "/";
|
|
||||||
redirectTixFiles = false;
|
|
||||||
withTmpDir = true;
|
|
||||||
}
|
|
||||||
''
|
|
||||||
delay="''${PGRST_DELAY:-0ms}"
|
|
||||||
echo "delaying data to/from PostgREST by $delay"
|
|
||||||
|
|
||||||
REAL_PGRST_SERVER_UNIX_SOCKET="$PGRST_SERVER_UNIX_SOCKET"
|
|
||||||
export PGRST_SERVER_UNIX_SOCKET="$tmpdir/postgrest.socket"
|
|
||||||
|
|
||||||
${slocat}/bin/slocat -delay "$delay" -src "$PGRST_SERVER_UNIX_SOCKET" -dst "$REAL_PGRST_SERVER_UNIX_SOCKET" &
|
|
||||||
SLOCAT_PID=$!
|
|
||||||
# shellcheck disable=SC2317
|
|
||||||
stop_slocat() {
|
|
||||||
kill "$SLOCAT_PID" || true
|
|
||||||
wait "$SLOCAT_PID" || true
|
|
||||||
}
|
|
||||||
trap stop_slocat EXIT
|
|
||||||
sleep 1 # should wait for socket file to appear instead
|
|
||||||
|
|
||||||
("$_arg_command" "''${_arg_leftovers[@]}")
|
|
||||||
'';
|
|
||||||
|
|
||||||
withGit =
|
withGit =
|
||||||
let
|
let
|
||||||
name = "postgrest-with-git";
|
name = "postgrest-with-git";
|
||||||
@@ -455,9 +379,7 @@ buildToolbox
|
|||||||
inherit
|
inherit
|
||||||
withGit
|
withGit
|
||||||
withPgAll
|
withPgAll
|
||||||
withPgrst
|
withPgrst;
|
||||||
withSlowPg
|
|
||||||
withSlowPgrst;
|
|
||||||
} // builtins.listToAttrs (
|
} // builtins.listToAttrs (
|
||||||
# Create a `postgrest-with-pg-` for each PostgreSQL version
|
# Create a `postgrest-with-pg-` for each PostgreSQL version
|
||||||
builtins.map (pg: { inherit (pg) name; value = withTmpDb pg; }) postgresqlVersions
|
builtins.map (pg: { inherit (pg) name; value = withTmpDb pg; }) postgresqlVersions
|
||||||
|
|||||||
Reference in New Issue
Block a user