Skip to content

security(deps): update pytest requirement from ~=7.1.0 to ~=9.0.0 in /backend/api/src/main/python #40

security(deps): update pytest requirement from ~=7.1.0 to ~=9.0.0 in /backend/api/src/main/python

security(deps): update pytest requirement from ~=7.1.0 to ~=9.0.0 in /backend/api/src/main/python #40

name: Python Backend Validation
on:
push:
branches: [ main, dev, 'feature/**' ]
pull_request:
branches: [ main, dev ]
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: backend/api/src/main/python/requirements.txt
- name: Install dependencies
working-directory: backend/api/src/main/python
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8 pytest pytest-cov
- name: Python syntax validation (F821 checks)
working-directory: backend/api/src/main/python
run: |
echo "🔍 Running F821 checks for undefined names..."
flake8 openapi_server/impl/ \
--count \
--select=E9,F63,F7,F82 \
--exclude="handler_map_documented.py" \
--show-source \
--statistics
- name: Architecture validation
working-directory: backend/api/src/main/python
run: |
echo "🏗️ Validating hexagonal architecture forwarding..."
python ../../../../../scripts/validate_handler_forwarding_comprehensive.py
- name: Run unit tests
working-directory: backend/api/src/main/python
run: |
echo "🧪 Running unit tests..."
pytest openapi_server/test/ \
--cov=openapi_server \
--cov-report=term-missing \
--cov-report=xml \
-v
- name: Run regression tests (non-DynamoDB)
working-directory: backend/api/src/main/python
run: |
echo "🔄 Running regression tests..."
# Skip tests that require DynamoDB/AWS credentials in CI
pytest tests/regression/ \
-v \
-k "not dynamodb" \
|| echo "⚠️ Some regression tests skipped (require AWS)"
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
file: backend/api/src/main/python/coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
continue-on-error: true
- name: Validation summary
if: always()
run: |
echo "=================================="
echo "✅ Python Validation Complete"
echo "=================================="
echo ""
echo "Checks performed:"
echo " - Python syntax (F821 undefined names)"
echo " - Hexagonal architecture forwarding"
echo " - Unit test suite"
echo " - Regression tests (non-AWS)"
echo ""
echo "See individual steps above for details."