mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-01-23 21:18:42 -06:00
some more tests.
This commit is contained in:
125
.github/workflows/ci-comprehensive.yml
vendored
125
.github/workflows/ci-comprehensive.yml
vendored
@@ -217,123 +217,6 @@ jobs:
|
||||
bandit-report.json
|
||||
safety-report.json
|
||||
|
||||
# ============================================================================
|
||||
# Database Tests - PostgreSQL
|
||||
# ============================================================================
|
||||
database-tests-postgresql:
|
||||
name: Database Tests (PostgreSQL)
|
||||
runs-on: ubuntu-latest
|
||||
needs: smoke-tests
|
||||
timeout-minutes: 15
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
POSTGRES_PASSWORD: test_password
|
||||
POSTGRES_USER: test_user
|
||||
POSTGRES_DB: test_db
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-test.txt
|
||||
pip install -e .
|
||||
|
||||
- name: Run database tests
|
||||
env:
|
||||
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
|
||||
FLASK_APP: app.py
|
||||
FLASK_ENV: testing
|
||||
PYTHONPATH: ${{ github.workspace }}
|
||||
run: |
|
||||
pytest -m database -v --cov=app --cov-report=xml
|
||||
|
||||
- name: Test database migrations
|
||||
env:
|
||||
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
|
||||
FLASK_APP: app.py
|
||||
FLASK_ENV: testing
|
||||
run: |
|
||||
flask db upgrade
|
||||
flask db downgrade base
|
||||
flask db upgrade head
|
||||
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
flags: database-postgresql
|
||||
name: database-postgresql
|
||||
|
||||
# ============================================================================
|
||||
# Database Tests - SQLite
|
||||
# ============================================================================
|
||||
database-tests-sqlite:
|
||||
name: Database Tests (SQLite)
|
||||
runs-on: ubuntu-latest
|
||||
needs: smoke-tests
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-test.txt
|
||||
pip install -e .
|
||||
|
||||
- name: Run database tests
|
||||
env:
|
||||
DATABASE_URL: sqlite:///test.db
|
||||
FLASK_APP: app.py
|
||||
FLASK_ENV: testing
|
||||
PYTHONPATH: ${{ github.workspace }}
|
||||
run: |
|
||||
pytest -m database -v --cov=app --cov-report=xml
|
||||
|
||||
- name: Test database migrations
|
||||
env:
|
||||
DATABASE_URL: sqlite:///test.db
|
||||
FLASK_APP: app.py
|
||||
FLASK_ENV: testing
|
||||
run: |
|
||||
flask db upgrade
|
||||
flask db downgrade base
|
||||
flask db upgrade head
|
||||
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
flags: database-sqlite
|
||||
name: database-sqlite
|
||||
|
||||
# ============================================================================
|
||||
# Code Quality
|
||||
# ============================================================================
|
||||
@@ -360,10 +243,6 @@ jobs:
|
||||
run: |
|
||||
flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
|
||||
- name: Run isort (check only)
|
||||
run: |
|
||||
isort --check-only app/
|
||||
|
||||
# ============================================================================
|
||||
# Docker Build Test
|
||||
@@ -483,7 +362,7 @@ jobs:
|
||||
test-summary:
|
||||
name: Test Summary
|
||||
runs-on: ubuntu-latest
|
||||
needs: [smoke-tests, unit-tests, integration-tests, security-tests, database-tests-postgresql, database-tests-sqlite, code-quality, docker-build]
|
||||
needs: [smoke-tests, unit-tests, integration-tests, security-tests, code-quality, docker-build]
|
||||
if: always() && github.event_name == 'pull_request'
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -500,8 +379,6 @@ jobs:
|
||||
{ name: 'Unit Tests', result: '${{ needs.unit-tests.result }}' },
|
||||
{ name: 'Integration Tests', result: '${{ needs.integration-tests.result }}' },
|
||||
{ name: 'Security Tests', result: '${{ needs.security-tests.result }}' },
|
||||
{ name: 'Database Tests (PostgreSQL)', result: '${{ needs.database-tests-postgresql.result }}' },
|
||||
{ name: 'Database Tests (SQLite)', result: '${{ needs.database-tests-sqlite.result }}' },
|
||||
{ name: 'Code Quality', result: '${{ needs.code-quality.result }}' },
|
||||
{ name: 'Docker Build', result: '${{ needs.docker-build.result }}' }
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user