[NX-501 Issue] Add E2E API smoke test workflow and related test suite
Some checks failed
Container CVE Scan (development) / Scan backend/frontend images for CVEs (push) Successful in 2m45s
E2E API Smoke / Core API E2E Smoke (push) Failing after 24s
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 8s
Proxy Profile Validation / validate (push) Successful in 3s
Python Dependency Security / pip-audit (block high/critical) (push) Successful in 26s
Some checks failed
Container CVE Scan (development) / Scan backend/frontend images for CVEs (push) Successful in 2m45s
E2E API Smoke / Core API E2E Smoke (push) Failing after 24s
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 8s
Proxy Profile Validation / validate (push) Successful in 3s
Python Dependency Security / pip-audit (block high/critical) (push) Successful in 26s
This commit introduces a GitHub Actions workflow for running E2E API smoke tests on main branches and pull requests. It includes a test suite covering authentication, CRUD operations, metrics access, and alerts status. The README is updated with instructions for running the tests locally.
This commit is contained in:
78
.github/workflows/e2e-api-smoke.yml
vendored
Normal file
78
.github/workflows/e2e-api-smoke.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: E2E API Smoke
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main", "master", "development"]
|
||||
paths:
|
||||
- "backend/**"
|
||||
- ".github/workflows/e2e-api-smoke.yml"
|
||||
pull_request:
|
||||
paths:
|
||||
- "backend/**"
|
||||
- ".github/workflows/e2e-api-smoke.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
e2e-smoke:
|
||||
name: Core API E2E Smoke
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_DB: nexapg
|
||||
POSTGRES_USER: nexapg
|
||||
POSTGRES_PASSWORD: nexapg
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U nexapg -d nexapg"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 20
|
||||
|
||||
env:
|
||||
APP_NAME: NexaPG Monitor
|
||||
ENVIRONMENT: test
|
||||
LOG_LEVEL: INFO
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PORT: 5432
|
||||
DB_NAME: nexapg
|
||||
DB_USER: nexapg
|
||||
DB_PASSWORD: nexapg
|
||||
JWT_SECRET_KEY: smoke_jwt_secret_for_ci_only
|
||||
JWT_ALGORITHM: HS256
|
||||
JWT_ACCESS_TOKEN_MINUTES: 15
|
||||
JWT_REFRESH_TOKEN_MINUTES: 10080
|
||||
ENCRYPTION_KEY: 5fLf8HSTbEUeo1c4DnWnvkXxU6v8XJ8iW58wNw5vJ8s=
|
||||
CORS_ORIGINS: http://localhost:5173
|
||||
POLL_INTERVAL_SECONDS: 30
|
||||
INIT_ADMIN_EMAIL: admin@example.com
|
||||
INIT_ADMIN_PASSWORD: ChangeMe123!
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install backend dependencies + test tooling
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r backend/requirements.txt
|
||||
pip install pytest
|
||||
|
||||
- name: Run Alembic migrations
|
||||
working-directory: backend
|
||||
run: alembic upgrade head
|
||||
|
||||
- name: Run core API smoke suite
|
||||
env:
|
||||
PYTHONPATH: backend
|
||||
run: pytest -q backend/tests/e2e/test_api_smoke.py
|
||||
Reference in New Issue
Block a user