fix(ci): add import diagnostics + pin pytest-cov + verbose error output

Add diagnostic steps to CI:
- Print installed test dep versions after pip install
- Verify app.main import chain before running pytest
- Show --tb=short for better error visibility

Pin pytest-cov==5.0.0 to prevent breaking transitive dep updates.

https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
This commit is contained in:
Claude 2026-04-17 05:46:10 +00:00
parent 3d03bbb2e3
commit 2423896232
No known key found for this signature in database
2 changed files with 14 additions and 2 deletions

View File

@ -25,14 +25,26 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt -r requirements-dev.txt
echo "--- Installed test deps ---"
pip show pytest pytest-asyncio pytest-cov aiosqlite httpx 2>/dev/null | grep -E "^(Name|Version):"
- name: Verify import chain
env:
DATABASE_URL: sqlite+aiosqlite:///./ci_verify.db
DEALIX_INTERNAL_API_TOKEN: ""
run: |
python -c "
from app.sqlite_patch import apply_patch; apply_patch()
from app.main import app; print('app.main import OK')
" || echo "IMPORT FAILED"
- name: Architecture Brief (governance validation)
working-directory: salesflow-saas
continue-on-error: true
run: python scripts/architecture_brief.py
- name: Pytest (full suite + launch scenarios)
env:
DATABASE_URL: sqlite+aiosqlite:///./ci_dealix.db
DEALIX_INTERNAL_API_TOKEN: ""
run: python -m pytest tests -q --tb=line
run: python -m pytest tests -q --tb=short
frontend:
runs-on: ubuntu-latest

View File

@ -64,7 +64,7 @@ structlog>=24.0.0 # Structured JSON logging with tenant context
# === Testing ===
pytest==8.3.4
pytest-asyncio==0.24.0 # Async test support — pinned for CI stability
pytest-cov>=5.0.0 # Coverage reporting
pytest-cov==5.0.0 # Coverage reporting — pinned for stability
factory-boy>=3.3.0 # Test data factories for SQLAlchemy models
# === Forecasting ===