Skip to content

Commit f3d6a2f

Browse files
committed
feat: make check-backend for quality checks
1 parent 6a898ce commit f3d6a2f

3 files changed

Lines changed: 32 additions & 12 deletions

File tree

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ validate-yamls: ## Validate all YAML configuration files
4141

4242
.PHONY: help
4343
help: ## Display this help message
44-
@python -c "import re; \
44+
@uv run python -c "import re; \
4545
p=r'$(firstword $(MAKEFILE_LIST))'.strip(); \
4646
[print(f'{m[0]:<20} {m[1]}') for m in re.findall(r'^([a-zA-Z_-]+):.*?## (.*)$$', open(p, encoding='utf-8').read(), re.M)]" | sort
47+
48+
# ==============================================================================
49+
# Quality Checks
50+
# ==============================================================================
51+
52+
.PHONY: check-backend
53+
check-backend: ## Run backend quality checks (tests + linting)
54+
@$(MAKE) backend-tests
55+
@$(MAKE) backend-lint
56+
57+
.PHONY: backend-tests
58+
backend-tests: ## Run backend tests
59+
@uv run pytest -v
60+
61+
.PHONY: backend-lint
62+
backend-lint: ## Run backend linting
63+
@uvx ruff check .

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,19 @@ dependencies = [
4545
requires = ["hatchling"]
4646
build-backend = "hatchling.build"
4747

48+
[tool.pytest.ini_options]
49+
pythonpath = ["."]
50+
testpaths = ["tests"]
51+
python_files = ["test_*.py"]
52+
python_classes = ["Test*"]
53+
python_functions = ["test_*"]
54+
addopts = "-v --tb=short"
55+
filterwarnings = [
56+
# Upstream SWIG issue in faiss-cpu on Python 3.12; awaiting SWIG 4.4 fix.
57+
"ignore:builtin type Swig.*:DeprecationWarning",
58+
"ignore:builtin type swigvarlink.*:DeprecationWarning",
59+
]
60+
61+
4862
[tool.uv]
4963
package = false

tests/test_memory_embedding_consistency.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
from runtime.node.agent.memory.memory_base import MemoryContentSnapshot, MemoryItem
44
from runtime.node.agent.memory.simple_memory import SimpleMemory
55

6-
7-
# ---------------------------------------------------------------------------
8-
# Helpers
9-
# ---------------------------------------------------------------------------
10-
116
def _make_store(memory_path=None):
127
"""Build a minimal MemoryStoreConfig mock for SimpleMemory."""
138
simple_cfg = MagicMock()
@@ -37,12 +32,7 @@ def _make_memory_item(item_id: str, dim: int):
3732
)
3833

3934

40-
# ---------------------------------------------------------------------------
41-
# Tests
42-
# ---------------------------------------------------------------------------
43-
4435
class TestSimpleMemoryRetrieveMixedDimensions:
45-
"""Task 2.1: verify retrieve() handles mixed-dimension embeddings."""
4636

4737
def test_mixed_dimensions_does_not_crash(self):
4838
"""Retrieve with mixed-dimensional embeddings MUST not raise."""
@@ -112,7 +102,6 @@ def test_all_wrong_dimension_returns_empty(self):
112102

113103

114104
class TestOpenAIEmbeddingDynamicFallback:
115-
"""Task 2.2: verify dynamic fallback dimension caching."""
116105

117106
def test_fallback_uses_model_dimension_after_success(self):
118107
"""After a successful call the fallback dimension MUST match the model."""

0 commit comments

Comments
 (0)