This commit is contained in:
@@ -31,5 +31,4 @@ jobs:
|
||||
|
||||
- name: Run MCP lint/format/tests via nix-shell
|
||||
run: |
|
||||
repo_root="$PWD"
|
||||
MCP_TESTS_WORKDIR="$repo_root" nix run .#mcp-tests
|
||||
nix run .#mcp-tests
|
||||
|
||||
@@ -36,27 +36,7 @@
|
||||
ruff
|
||||
];
|
||||
text = ''
|
||||
start_dir="$PWD"
|
||||
if [ -n "''${MCP_TESTS_WORKDIR:-}" ]; then
|
||||
cd "''${MCP_TESTS_WORKDIR}"
|
||||
elif [ -n "''${GITEA_WORKSPACE:-}" ]; then
|
||||
cd "''${GITEA_WORKSPACE}"
|
||||
elif [ -n "''${GITHUB_WORKSPACE:-}" ]; then
|
||||
cd "''${GITHUB_WORKSPACE}"
|
||||
elif command -v git >/dev/null 2>&1; then
|
||||
repo_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
|
||||
if [ -n "$repo_root" ]; then
|
||||
cd "$repo_root"
|
||||
fi
|
||||
fi
|
||||
while [ ! -x ./scripts/mcp-server/run-tests.sh ]; do
|
||||
if [ "$PWD" = "/" ]; then
|
||||
echo "Could not find executable scripts/mcp-server/run-tests.sh starting from $start_dir" >&2
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
done
|
||||
exec bash ./scripts/mcp-server/run-tests.sh "$@"
|
||||
exec bash ${inputs.self}/scripts/mcp-server/run-tests.sh "$@"
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
@@ -8,10 +8,13 @@ cd "$here"
|
||||
|
||||
cache_root="${TMPDIR:-/tmp}/mcp-tests-cache"
|
||||
mkdir -p "$cache_root"
|
||||
export HOME="${TMPDIR:-/tmp}/mcp-tests-home"
|
||||
mkdir -p "$HOME"
|
||||
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"
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
fix=false
|
||||
for arg in "$@"; do
|
||||
|
||||
Reference in New Issue
Block a user