Skip to content

build(deps): bump cryptography from 46.0.5 to 46.0.6 in /src/backend #1019

build(deps): bump cryptography from 46.0.5 to 46.0.6 in /src/backend

build(deps): bump cryptography from 46.0.5 to 46.0.6 in /src/backend #1019

Workflow file for this run

name: Test Workflow with Coverage
on:
push:
branches:
- main
- demo-v4
- dev-v4
paths:
- 'src/backend/**/*.py'
- 'src/tests/**/*.py'
- 'src/mcp_server/**/*.py'
- 'src/**/pyproject.toml'
- 'pytest.ini'
- 'conftest.py'
- 'src/backend/requirements.txt'
- '.github/workflows/test.yml'
pull_request:
types:
- opened
- ready_for_review
- reopened
- synchronize
branches:
- main
- demo-v4
- dev-v4
paths:
- 'src/backend/**/*.py'
- 'src/tests/**/*.py'
- 'src/mcp_server/**/*.py'
- 'pytest.ini'
- 'conftest.py'
- 'src/backend/requirements.txt'
- 'src/**/pyproject.toml'
- '.github/workflows/test.yml'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/backend/requirements.txt
- name: Check if test files exist
id: check_tests
run: |
if [ -z "$(find src -type f -name 'test_*.py')" ]; then
echo "No test files found, skipping tests."
echo "skip_tests=true" >> $GITHUB_ENV
else
echo "Test files found, running tests."
echo "skip_tests=false" >> $GITHUB_ENV
fi
- name: Run tests with coverage
if: env.skip_tests == 'false'
env:
PYTHONPATH: src:src/backend
run: |
# Run test_app.py first (isolation required)
python -m pytest src/tests/backend/test_app.py --cov=src/backend --cov-config=.coveragerc -q
# Run remaining backend tests with coverage append
python -m pytest src/tests/backend --cov=src/backend --cov-append --cov-report=term --cov-report=xml --cov-config=.coveragerc --ignore=src/tests/backend/test_app.py
- name: Check coverage threshold
if: env.skip_tests == 'false'
run: |
if [ -f coverage.xml ]; then
COVERAGE=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(float(root.attrib.get('line-rate', 0)) * 100)")
echo "Overall coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
echo "::error::Coverage is below 80% threshold. Current: $COVERAGE%"
exit 1
fi
echo "✅ Coverage threshold met: $COVERAGE% >= 80%"
else
echo "::error::coverage.xml not found"
exit 1
fi
- name: Skip coverage report if no tests
if: env.skip_tests == 'true'
run: |
echo "Skipping coverage report because no tests were found."