test: them 81 pytest cho auth/orders/security/CORS/risk_manager/trade_executor/signal_service + CI
Backend truoc day chi co script goi httpx vao server dang chay that (test_auth.py, test_full_api.py), khong phai pytest that. Them bo test chay doc lap bang SQLite in-memory (khong can Postgres/Docker): - test_rbac_deps.py: RBAC chain + regression-guard cho fix vai tro o /orders/place - test_order_exchange_routing.py: routing dung san theo credential - test_security_encryption.py: AES-GCM round-trip + tuong thich nguoc AES-CBC - test_cors_config.py: CORS fail-closed khi thieu cau hinh - test_risk_manager.py: Kelly sizing + SL/TP adaptive theo tung regime - test_trade_executor.py: STRONG-only, dedup, reversal, volatility filter, hybrid eviction FIFO -- toan bo quy tac mo/dong trade - test_signal_service_scoring.py: he thong cham diem 13 thuat toan Them .gitea/workflows/backend-tests.yml chay pytest tu dong khi push/PR dung vao backend/** (can Gitea Actions + runner da duoc bat tren instance). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
name: Backend tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- "backend/**"
|
||||
- ".gitea/workflows/backend-tests.yml"
|
||||
pull_request:
|
||||
paths:
|
||||
- "backend/**"
|
||||
- ".gitea/workflows/backend-tests.yml"
|
||||
|
||||
jobs:
|
||||
pytest:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: backend
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt -r requirements-dev.txt
|
||||
|
||||
- name: Run pytest
|
||||
run: python -m pytest tests/ -v
|
||||
Reference in New Issue
Block a user