feat: add CI/CD testing infrastructure with test.sh orchestrator

Complete testing system: pyproject.toml (pytest markers), test.sh
orchestrator with auto app start/stop and colorful summary,
pre-push hook, Gitea Actions workflow.

New QA tests: API health (7 endpoints), responsive (3 viewports),
log monitoring (ERROR/ORA-/Traceback detection), real GoMag sync,
PL/SQL package validation, smoke prod (read-only).

Converted test_app_basic.py and test_integration.py to pytest.
Added pytestmark to all existing tests (unit/e2e/oracle).
E2E conftest upgraded: console error collector, screenshot on
failure, auto-detect live app on :5003.

Usage: ./test.sh ci (30s) | ./test.sh full (2-3min)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-24 10:40:25 +00:00
parent 65dcafba03
commit 419464a62c
27 changed files with 1906 additions and 409 deletions

View File

@@ -22,12 +22,42 @@ Documentatie completa: [README.md](README.md)
# INTOTDEAUNA via start.sh (seteaza Oracle env vars)
./start.sh
# NU folosi uvicorn direct — lipsesc LD_LIBRARY_PATH si TNS_ADMIN
# Tests
python api/test_app_basic.py # fara Oracle
python api/test_integration.py # cu Oracle
```
## Testing & CI/CD
```bash
# Teste rapide (unit + e2e, ~30s, fara Oracle)
./test.sh ci
# Teste complete (totul inclusiv Oracle + sync real + PL/SQL, ~2-3 min)
./test.sh full
# Smoke test pe productie (read-only, dupa deploy)
./test.sh smoke-prod --base-url http://79.119.86.134/gomag
# Doar un layer specific
./test.sh unit # SQLite CRUD, imports, routes
./test.sh e2e # Browser tests (Playwright)
./test.sh oracle # Oracle integration
./test.sh sync # Sync real GoMag → Oracle
./test.sh qa # API health + responsive + log monitor
./test.sh logs # Doar log monitoring
# Validate prerequisites
./test.sh --dry-run
```
**Flow zilnic:**
1. Lucrezi pe branch `fix/*` sau `feat/*`
2. `git push` → pre-push hook ruleaza `./test.sh ci` automat (~30s)
3. Inainte de PR → `./test.sh full` manual (~2-3 min)
4. Dupa deploy pe prod → `./test.sh smoke-prod --base-url http://79.119.86.134/gomag`
**Output:** `qa-reports/` — health score, raport markdown, screenshots, baseline comparison.
**Markers pytest:** `unit`, `oracle`, `e2e`, `qa`, `sync`
## Reguli critice (nu le incalca)
### Flux import comenzi