refactor: move services to a unit of work over repository ports
Services depend only on src/core/ports: async with self.uow is one transaction, commit is explicit, leaving without it rolls back. A connection is held per step, the JSON routers keep a shared request deadline, and rollback runs under the block deadline. Adds service-tests with fakes, a repo contract run on both the fake and SQL, and make service_test / service_test_db. API, schema and settings are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -103,6 +103,11 @@ jobs:
|
||||
uv sync -q
|
||||
make validate PYTHON=.venv/bin/python
|
||||
|
||||
- name: make service_test
|
||||
# без хранилищ и docker: фейки; service_test_db нужен порт PostgreSQL
|
||||
# на хосте, в CI его нет (design change unit-of-work, решение 13)
|
||||
run: make service_test
|
||||
|
||||
- name: make student_test
|
||||
# через LB: тесты реплик выполняются, проверки отказов — нет
|
||||
run: make student_test
|
||||
|
||||
Reference in New Issue
Block a user