Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
Empty file.
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ testpaths = [
# passed positionally (e.g. ``pytest packages/tapps-mcp``), which overrides
# testpaths. Excluding src/ keeps that invocation hermetic.
norecursedirs = ["src", ".venv", "*.egg", "build", "dist", "node_modules"]
# TAP-4575: docs-mcp test modules import shared fixtures via ``from tests.helpers
# import ...``. With the tests/__init__.py files removed (so the three packages'
# identically named ``tests`` trees no longer collide under importlib), that
# import resolves only if docs-mcp's package root is on the path and ``tests`` is
# treated as a namespace package (consider_namespace_packages above). Only
# docs-mcp ships tests/helpers.py, so this is unambiguous.
pythonpath = ["packages/docs-mcp"]
asyncio_mode = "auto"
timeout = 60
markers = [
Expand All @@ -195,7 +202,13 @@ markers = [
"optional_deps: marks tests requiring optional dependencies (sentence-transformers, faiss-cpu, cohere)",
"brain_contract: marks tests requiring a running tapps-brain HTTP server (3.18+)",
]
addopts = "-v --tb=short -p randomly --randomly-seed=last"
addopts = "-v --tb=short -p randomly --randomly-seed=last --import-mode=importlib"
# TAP-4575: importlib import mode lets the three packages' identically named
# ``tests`` trees (each ships tests/__init__.py) be collected together from the
# repo root without pytest's rootdir-based ImportPathMismatchError. Namespace
# packages must be considered so docs-mcp's ``from tests.helpers import ...``
# still resolves under importlib mode.
consider_namespace_packages = true
filterwarnings = [
"ignore:tapps_core\\.memory is deprecated:DeprecationWarning",
"ignore:tapps_core\\.memory\\.gc is deprecated:DeprecationWarning",
Expand Down
6 changes: 4 additions & 2 deletions scripts/prepush-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
# Intentionally avoids pytest-xdist (-n auto): parallel runs starve live Cursor
# MCP child processes during push and can flake unrelated integration tests.
#
# Each test path runs in its own pytest invocation to avoid conftest.py
# ImportPathMismatchError across packages.
# Each curated test path runs in its own serial pytest invocation for that
# xdist-avoidance reason. (The cross-package conftest.py ImportPathMismatchError
# that once forced separate invocations is fixed — TAP-4575 added
# --import-mode=importlib so a single root run collects all three packages.)

set -euo pipefail

Expand Down
17 changes: 6 additions & 11 deletions scripts/run-regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@ if [[ "${1:-}" == "--serial" ]]; then
XDIST=()
fi

echo "[regression] Full non-slow suite (all packages). Not part of git push." >&2
FAILED=0
for PKG in packages/tapps-mcp packages/tapps-core packages/docs-mcp; do
echo "[regression] $PKG/tests/" >&2
if ! uv run pytest "$PKG/tests/" -m "not slow" -q --tb=line --timeout=60 "${XDIST[@]}" --maxfail=3; then
FAILED=1
fi
done

if [[ "$FAILED" -ne 0 ]]; then
echo "[regression] FAILED — investigate with: uv run pytest <pkg>/tests/ -m 'not slow' -v" >&2
echo "[regression] Full non-slow suite (all packages, single invocation). Not part of git push." >&2
# TAP-4575: the three packages' tests are collected in one root pytest run
# (testpaths + --import-mode=importlib in pyproject.toml). No more per-package
# loop — a single invocation restores cross-package xdist parallelism.
if ! uv run pytest -m "not slow" -q --tb=line --timeout=60 "${XDIST[@]}" --maxfail=3; then
echo "[regression] FAILED — investigate with: uv run pytest -m 'not slow' -v" >&2
exit 1
fi

Expand Down
Loading