diff --git a/parts/packages.nix b/parts/packages.nix index 13950a7..ef5f39a 100644 --- a/parts/packages.nix +++ b/parts/packages.nix @@ -36,7 +36,11 @@ ruff ]; text = '' - exec bash ${inputs.self}/scripts/mcp-server/run-tests.sh "$@" + if [ ! -x ./scripts/mcp-server/run-tests.sh ]; then + echo "Expected ./scripts/mcp-server/run-tests.sh to be executable from repo root." >&2 + exit 1 + fi + exec bash ./scripts/mcp-server/run-tests.sh "$@" ''; }; in diff --git a/scripts/mcp-server/run-tests.sh b/scripts/mcp-server/run-tests.sh index aa544b0..ad18d58 100755 --- a/scripts/mcp-server/run-tests.sh +++ b/scripts/mcp-server/run-tests.sh @@ -6,6 +6,13 @@ set -euo pipefail here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$here" +cache_root="${TMPDIR:-/tmp}/mcp-tests-cache" +mkdir -p "$cache_root" +export XDG_CACHE_HOME="$cache_root/xdg" +export RUFF_CACHE_DIR="$cache_root/ruff" +export MYPY_CACHE_DIR="$cache_root/mypy" +export PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} -o cache_dir=$cache_root/pytest" + fix=false for arg in "$@"; do if [ "$arg" = "--fix" ]; then