2023-09-22 16:32:09 +00:00
|
|
|
{ ... }: {
|
|
|
|
perSystem = { pkgs, lib, ... }: {
|
2023-11-08 18:50:31 +00:00
|
|
|
packages = rec {
|
2023-09-22 16:32:09 +00:00
|
|
|
# a script that executes all other checks
|
|
|
|
impure-checks = pkgs.writeShellScriptBin "impure-checks" ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
export PATH="${lib.makeBinPath [
|
|
|
|
pkgs.gitMinimal
|
|
|
|
pkgs.nix
|
2023-09-29 16:30:11 +00:00
|
|
|
pkgs.rsync # needed to have rsync installed on the dummy ssh server
|
2023-09-22 16:32:09 +00:00
|
|
|
]}"
|
|
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
|
|
cd "$ROOT/pkgs/clan-cli"
|
2023-11-09 08:30:25 +00:00
|
|
|
nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -m impure -s ./tests $@"
|
2023-09-22 16:32:09 +00:00
|
|
|
'';
|
2023-11-08 18:50:31 +00:00
|
|
|
|
|
|
|
runMockApi = pkgs.writeShellScriptBin "run-mock-api" ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
export PATH="${lib.makeBinPath [
|
|
|
|
pkgs.gitMinimal
|
|
|
|
pkgs.nix
|
|
|
|
pkgs.rsync # needed to have rsync installed on the dummy ssh server
|
|
|
|
pkgs.coreutils
|
|
|
|
pkgs.procps
|
|
|
|
]}"
|
|
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
|
|
cd "$ROOT/pkgs/clan-cli"
|
|
|
|
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp python -m clan_cli webui --no-open --port 2979'
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
runSchemaTests = pkgs.writeShellScriptBin "runSchemaTests" ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
${runMockApi}/bin/run-mock-api &
|
|
|
|
MOCK_API_PID=$!
|
|
|
|
echo "Started mock api with pid $MOCK_API_PID"
|
|
|
|
function cleanup {
|
|
|
|
echo "Stopping server..."
|
|
|
|
pkill -9 -f "python -m clan_cli webui"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
export PATH="${lib.makeBinPath [
|
|
|
|
pkgs.gitMinimal
|
|
|
|
pkgs.nix
|
|
|
|
pkgs.rsync # needed to have rsync installed on the dummy ssh server
|
|
|
|
pkgs.procps
|
|
|
|
pkgs.coreutils
|
|
|
|
]}"
|
|
|
|
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
|
|
cd "$ROOT/pkgs/clan-cli"
|
|
|
|
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp st auth login RHtr8nLtz77tqRP8yUGyf-Flv_9SLI'
|
|
|
|
nix develop "$ROOT#clan-cli" -c bash -c 'TMPDIR=/tmp st run http://localhost:2979/openapi.json --experimental=openapi-3.1 --report --workers 8 --max-response-time=50 --request-timeout=1000 -M GET'
|
|
|
|
'';
|
2023-08-26 22:18:17 +00:00
|
|
|
};
|
2023-09-22 16:32:09 +00:00
|
|
|
};
|
2023-08-26 22:18:17 +00:00
|
|
|
}
|