DEDICATED TEST WORKFLOW: Separate testing from main CI
Creates python-tests.yml with comprehensive test handling:
Features:
- Separate workflow from main CI (keeps CI clean)
- Comprehensive Python path setup for import resolution
- Install ALL dependencies with poetry (not --no-root)
- Additional dependencies: pydantic-settings, pytest-cov, pytest-mock
- Multiple PYTHONPATH entries for complex project structure
- Two jobs: general tests + specific tests (manual trigger)
Import Error Handling:
- Full project installation (poetry install)
- Multiple Python path entries:
- /opt/gitea-runner/workspace/repo
- /opt/gitea-runner/workspace/repo/src
- /opt/gitea-runner/workspace/repo/apps
- /opt/gitea-runner/workspace/repo/apps/*/src
- Missing dependencies: pydantic-settings
- Error tolerance: --maxfail=5, --tb=short
Benefits:
- Main CI stays clean and fast
- Tests can fail without blocking CI
- Comprehensive test environment setup
- Manual trigger for specific test debugging
- Better import resolution for complex project structure
This separates concerns: CI focuses on build/deployment,
while this workflow focuses on comprehensive testing.