Webapp: no test coverage for backend or frontend
- Vorherrschende Sprache
- Python
- Sterne
- 23
- Forks
- 28
- Ø Merge
- 4 T. 12 Std.
- Gemergte PRs (30 T.)
- 5
Beschreibung
Follow-up from review on #423 — checklist item: "Add unit tests for webapp backend and frontend or at least create an issue for this."
## Current state
`leakpro/webapp/` (backend: `main.py` ~1180 lines, `worker.py` ~440 lines, `models.py` ~155 lines; frontend: 7-step wizard in `components/steps/`) has **zero test coverage** — no test files exist under `leakpro/webapp/` at all, backend or frontend.
This is now the primary way LeakPro is used interactively (job upload → data format → arch/handler setup → train → configure attacks → run → results), and it's grown substantially (binary/tabular support, DP-SGD, custom handler uploads) without any regression safety net. The RMIA/BASE/loss_traj crashes caught in #423's review are a symptom of this more broadly — bugs only surface when someone happens to click through the right path manually.
## Suggested scope (backend, FastAPI)
Priority endpoints to cover first, since they're where correctness bugs actually live:
- `/jobs/{id}/train` — the binary-detection probe (`_is_binary`), criterion selection, DP-SGD path, custom-handler.py path
- `/jobs/{id}/validate/model-metadata` — required-fields check
- `/jobs/{id}/sample_data/{index}` — new tabular results endpoint from #423
- Job lifecycle: create → upload → format → status transitions
## Suggested scope (frontend)
- `Step4Models.tsx` — training config + binary/tabular preset wiring
- `Step7Results.tsx` — the new tabular row-detail modal from #423
- At minimum, a build/typecheck gate in CI (`npm run build`) if component tests are too large a first step
## Non-goals for a first pass
Full E2E browser tests — start with unit/integration tests around the FastAPI endpoints and the riskiest frontend logic (binary detection, config validation), not full click-through coverage.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.