将 pytest 和 Ruff 配置集中到 pyproject.toml,显式加入 backend import path,补充健康检查测试和 Ruff 依赖,并忽略本地缓存与 macOS 元数据。
@@ -1,8 +1,11 @@
.cache/*
!.cache/.gitkeep
+.DS_Store
+**/.DS_Store
backend/.venv/
backend/**/__pycache__/
backend/.pytest_cache/
+backend/.ruff_cache/
frontend/.next/
frontend/node_modules/
frontend/coverage/
@@ -0,0 +1,15 @@
+[tool.pytest.ini_options]
+testpaths = ["tests"]
+addopts = "-q"
+pythonpath = ["."]
+
+[tool.ruff]
+line-length = 100
+target-version = "py39"
+[tool.ruff.lint]
+select = ["E", "F", "I", "UP", "B", "ASYNC", "RUF"]
+ignore = ["RUF001", "UP045"]
+[tool.ruff.lint.isort]
+known-first-party = ["app"]
@@ -1,4 +0,0 @@
-[pytest]
-testpaths = tests
-addopts = -q
-
@@ -2,5 +2,5 @@ fastapi==0.116.1
httpx==0.28.1
pydantic==2.11.7
pytest==8.4.1
+ruff==0.15.22
uvicorn==0.35.0
@@ -0,0 +1,13 @@
+from fastapi.testclient import TestClient
+from app.main import app
+def test_health_reports_journey_service() -> None:
+ response = TestClient(app).get("/api/health")
+ assert response.status_code == 200
+ assert response.json() == {
+ "status": "ok",
+ "service": "script-build-journey",
+ }