Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d5b033749 | ||
|
|
748d1cbfae | ||
|
|
a9a5731991 |
@@ -59,9 +59,9 @@
|
|||||||
"Bash(redis-cli * FLUSHDB*)",
|
"Bash(redis-cli * FLUSHDB*)",
|
||||||
"Bash(redis-cli FLUSHALL*)",
|
"Bash(redis-cli FLUSHALL*)",
|
||||||
"Bash(redis-cli FLUSHDB*)",
|
"Bash(redis-cli FLUSHDB*)",
|
||||||
"Bash(rm -rf $HOME*)",
|
"Bash(rm -rf $HOME)",
|
||||||
"Bash(rm -rf /*)",
|
"Bash(rm -rf /)",
|
||||||
"Bash(rm -rf ~*)",
|
"Bash(rm -rf ~)",
|
||||||
"Bash(su *)",
|
"Bash(su *)",
|
||||||
"Bash(sudo *)",
|
"Bash(sudo *)",
|
||||||
"Bash(toj)",
|
"Bash(toj)",
|
||||||
|
|||||||
@@ -18,19 +18,67 @@ help: ## Show this help
|
|||||||
| awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
|
| awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
.PHONY: setup
|
.PHONY: setup
|
||||||
setup: ## Create the venv and install dependencies
|
setup: ## Create the venv, install dependencies, and prove the result works
|
||||||
$(PYTHON) -m venv .venv
|
$(PYTHON) -m venv .venv
|
||||||
$(VENV)/bin/pip install -r requirements.txt
|
# requirements-dev.txt pulls in requirements.txt via -r, so this is still
|
||||||
|
# the full runtime set plus pytest/ruff. Installing only requirements.txt
|
||||||
|
# here (as this line originally did) left `make test` and `make lint`
|
||||||
|
# unreachable from a clean `make setup` since the Makefile's introduction
|
||||||
|
# in b9f55cb — pytest was never installed by setup at all. Found by the
|
||||||
|
# check below failing on its first clean-tree run; fixed in the same
|
||||||
|
# commit rather than filed separately, since the new check cannot pass
|
||||||
|
# honestly against the old line.
|
||||||
|
$(VENV)/bin/pip install -r requirements-dev.txt
|
||||||
|
# Exit 0 from pip install is not evidence (D-24) — it is the same exit code
|
||||||
|
# whether requirements.txt matches what's on disk or a dependency silently
|
||||||
|
# failed to install. Two cheap checks, for two different drift modes:
|
||||||
|
# pip check - installed packages satisfy each other's declared
|
||||||
|
# version constraints (a stale/partial install).
|
||||||
|
# pytest --collect-only - every test module actually imports, which
|
||||||
|
# walks the full src/ import graph and is exactly
|
||||||
|
# what catches a *missing* declared dependency
|
||||||
|
# (core-api's sqlalchemy case in T-47). It builds
|
||||||
|
# no client and opens no socket - dependencies.py
|
||||||
|
# wraps client construction in lru_cache getters,
|
||||||
|
# never called at collection time - so this needs
|
||||||
|
# none of the five backing services running.
|
||||||
|
$(VENV)/bin/pip check
|
||||||
|
$(VENV)/bin/python -m pytest tests/ --collect-only -q
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: ## Dev server on :8778 with reload (8089 is the container, not this)
|
run: ## Dev server on :8778 with reload (8089 is the container, not this)
|
||||||
./wakeup.sh
|
./wakeup.sh
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: ## Run the test suite
|
test: ## Run the test suite (no network needed — live tests are marked and self-skip)
|
||||||
@test -x $(VENV)/bin/python || { echo "FAIL — no venv; run: make setup"; exit 69; }
|
@test -x $(VENV)/bin/python || { echo "FAIL — no venv; run: make setup"; exit 69; }
|
||||||
$(VENV)/bin/python -m pytest tests/
|
$(VENV)/bin/python -m pytest tests/
|
||||||
|
|
||||||
|
# The `integration` marker and its RUN_INTEGRATION_TESTS/TEST_TENANT gate already
|
||||||
|
# lived in tests/conftest.py before T-55 (see test_integration.py,
|
||||||
|
# test_tenant_isolation_live.py, test_quality_report_live.py, and the
|
||||||
|
# TestWikiChangeListenerIntegration class) — `make test` never ran them because
|
||||||
|
# `pytest_collection_modifyitems` skips anything carrying the marker unless
|
||||||
|
# RUN_INTEGRATION_TESTS=1. That gate made them silent under `make test`, but
|
||||||
|
# nothing ran them WITH the flag set either, so "runnable" had never been
|
||||||
|
# reasserted. This target is that home (D-26): it sets the flag, selects the
|
||||||
|
# marker, and — the part that matters — fails loudly if selection ever drops to
|
||||||
|
# zero, since a target that passes by collecting nothing is worse than one that
|
||||||
|
# needs a network (T-55).
|
||||||
|
.PHONY: test-integration
|
||||||
|
test-integration: ## Live tests against neo4j/qdrant/wikijs/searxng/ollama (needs network + services)
|
||||||
|
@test -x $(VENV)/bin/python || { echo "FAIL — no venv; run: make setup"; exit 69; }
|
||||||
|
@$(VENV)/bin/python -m pytest tests/ -m integration --collect-only -q >/dev/null 2>&1; \
|
||||||
|
rc=$$?; \
|
||||||
|
if [ "$$rc" = "5" ]; then \
|
||||||
|
echo "FAIL test-integration — selected 0 tests (marker renamed, moved, or lost — this is a defect, not a pass)"; \
|
||||||
|
exit 1; \
|
||||||
|
elif [ "$$rc" != "0" ]; then \
|
||||||
|
echo "FAIL test-integration — collection errored (rc=$$rc)"; \
|
||||||
|
exit $$rc; \
|
||||||
|
fi
|
||||||
|
RUN_INTEGRATION_TESTS=1 $(VENV)/bin/python -m pytest tests/ -m integration -v
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: ## ruff check over the sources
|
lint: ## ruff check over the sources
|
||||||
@test -x $(VENV)/bin/ruff || { echo "FAIL — ruff not installed; run: make setup"; exit 69; }
|
@test -x $(VENV)/bin/ruff || { echo "FAIL — ruff not installed; run: make setup"; exit 69; }
|
||||||
|
|||||||
@@ -285,6 +285,7 @@ class TestAddEntityLinksToContent:
|
|||||||
# Integration Tests - Full Entity Linking Flow
|
# Integration Tests - Full Entity Linking Flow
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
|
@pytest.mark.integration
|
||||||
class TestEntityLinkingIntegration:
|
class TestEntityLinkingIntegration:
|
||||||
"""Test full entity linking flow."""
|
"""Test full entity linking flow."""
|
||||||
|
|
||||||
@@ -421,6 +422,7 @@ class TestEntityLinkingIntegration:
|
|||||||
# Multi-Tenancy Tests
|
# Multi-Tenancy Tests
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
|
@pytest.mark.integration
|
||||||
class TestEntityLinkingMultiTenancy:
|
class TestEntityLinkingMultiTenancy:
|
||||||
"""Test multi-tenancy isolation in entity linking."""
|
"""Test multi-tenancy isolation in entity linking."""
|
||||||
|
|
||||||
@@ -464,6 +466,7 @@ class TestEntityLinkingMultiTenancy:
|
|||||||
# Cleanup
|
# Cleanup
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
|
@pytest.mark.integration
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_cleanup_entity_linking_test_data(neo4j_client):
|
async def test_cleanup_entity_linking_test_data(neo4j_client):
|
||||||
"""Clean up all test data created by entity linking tests."""
|
"""Clean up all test data created by entity linking tests."""
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ from src.services.graph_service import GraphService
|
|||||||
from src.models.hybrid_rag import HybridRAGConfig
|
from src.models.hybrid_rag import HybridRAGConfig
|
||||||
from src.config import get_settings
|
from src.config import get_settings
|
||||||
|
|
||||||
|
# Every test in this module goes through hybrid_rag_service -> graph_service ->
|
||||||
|
# neo4j_client, which opens a real Bolt connection at fixture setup (T-55/D-26).
|
||||||
|
# There is no unit/integration split within the file: even the fusion/formatting
|
||||||
|
# classes that look like pure logic still resolve the full fixture chain, so the
|
||||||
|
# whole module is marked rather than picking classes apart from underneath.
|
||||||
|
pytestmark = pytest.mark.integration
|
||||||
|
|
||||||
# Test user to isolate test data
|
# Test user to isolate test data
|
||||||
TEST_USER = "llm-tester"
|
TEST_USER = "llm-tester"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user