Skip to content

Commit b096cf8

Browse files
CopilotSteake
andcommitted
test: add end-to-end integration tests for cognitive pipeline (NLU→KR→Inference→NLG)
Add 14 integration tests in tests/integration/test_cognitive_pipeline.py covering: - Single-query round-trip (NLU → KR write/read → NLG) - Knowledge persistence within session (add/retract/query patterns) - Context switching (discourse manager across multiple utterances) - Inference chain (Socrates syllogism, two-hop reasoning via resolution) - Full pipeline round-trip (NLU → KR → Inference → NLG) All tests mock spaCy at the LexicalAnalyzerParser level so they run in CI without optional native packages. Add `standalone` marker to opt out of the `requires_backend` auto-skip for in-process tests. Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
1 parent 9bcc711 commit b096cf8

File tree

4 files changed

+663
-1
lines changed

4 files changed

+663
-1
lines changed

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ markers =
3333
slow: Slow running tests
3434
requires_backend: Tests requiring running backend
3535
requires_frontend: Tests requiring running frontend
36+
standalone: In-process tests that do not require external services
3637

3738
# Asyncio configuration
3839
asyncio_mode = auto

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ def pytest_configure(config):
8484
config.addinivalue_line(
8585
"markers", "requires_frontend: mark test as requiring running frontend"
8686
)
87+
config.addinivalue_line(
88+
"markers", "standalone: in-process tests that do not require external services"
89+
)
8790

8891

8992
# Global fixtures for test environment
@@ -136,7 +139,9 @@ def test_config():
136139
def pytest_runtest_setup(item):
137140
"""Set up individual test runs with conditional skipping."""
138141
# Skip backend tests if backend is not available
139-
if "requires_backend" in [mark.name for mark in item.iter_markers()]:
142+
# Tests marked ``standalone`` run in-process and never contact a server.
143+
marker_names = [mark.name for mark in item.iter_markers()]
144+
if "requires_backend" in marker_names and "standalone" not in marker_names:
140145
try:
141146
import requests
142147
response = requests.get("http://localhost:8000/health", timeout=2)

tests/integration/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""
2+
Local conftest for ``tests/integration/``.
3+
4+
The root conftest auto-tags every file under ``integration/`` with the
5+
``requires_backend`` marker. The cognitive-pipeline integration tests
6+
exercise core subsystems **in-process** and never contact a running server,
7+
so they carry the ``standalone`` marker that suppresses the backend check.
8+
"""

0 commit comments

Comments
 (0)