test.......
All checks were successful
MCP Tests / mcp-tests (push) Successful in 15s

This commit is contained in:
Danilo Reyes
2026-02-08 15:15:02 -06:00
parent 6d29835303
commit b5c7024ea4
3 changed files with 5 additions and 23 deletions

View File

@@ -31,5 +31,4 @@ jobs:
- name: Run MCP lint/format/tests via nix-shell - name: Run MCP lint/format/tests via nix-shell
run: | run: |
repo_root="$PWD" nix run .#mcp-tests
MCP_TESTS_WORKDIR="$repo_root" nix run .#mcp-tests

View File

@@ -36,27 +36,7 @@
ruff ruff
]; ];
text = '' text = ''
start_dir="$PWD" exec bash ${inputs.self}/scripts/mcp-server/run-tests.sh "$@"
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 "$@"
''; '';
}; };
in in

View File

@@ -8,10 +8,13 @@ cd "$here"
cache_root="${TMPDIR:-/tmp}/mcp-tests-cache" cache_root="${TMPDIR:-/tmp}/mcp-tests-cache"
mkdir -p "$cache_root" mkdir -p "$cache_root"
export HOME="${TMPDIR:-/tmp}/mcp-tests-home"
mkdir -p "$HOME"
export XDG_CACHE_HOME="$cache_root/xdg" export XDG_CACHE_HOME="$cache_root/xdg"
export RUFF_CACHE_DIR="$cache_root/ruff" export RUFF_CACHE_DIR="$cache_root/ruff"
export MYPY_CACHE_DIR="$cache_root/mypy" export MYPY_CACHE_DIR="$cache_root/mypy"
export PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} -o cache_dir=$cache_root/pytest" export PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} -o cache_dir=$cache_root/pytest"
export PYTHONDONTWRITEBYTECODE=1
fix=false fix=false
for arg in "$@"; do for arg in "$@"; do