Commit Graph

15 Commits

Author SHA1 Message Date
Georges-Antoine Assi
71d5d3a47f refactor raw endpoint 2026-07-01 08:58:00 -04:00
Georges-Antoine Assi
26cf4b36f8 Scope test-user grant to the romm_test namespace
Addresses review feedback: granting ALL PRIVILEGES on *.* is overly broad,
especially against a shared DB instance. A database-level grant on the
`romm\_test%` wildcard pattern still lets the user CREATE the per-worker
databases (romm_test_gw0, ...) needed by pytest-xdist, while confining it to
that namespace — verified that out-of-namespace CREATE DATABASE is denied.

PostgreSQL needs no equivalent change: its CI service user (POSTGRES_USER)
is the container superuser.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:34:46 -04:00
Georges-Antoine Assi
02815ec403 Run backend tests in parallel with pytest-xdist
Add pytest-xdist and run the backend test suite across multiple workers
(`-n 4` in CI). Each worker gets its own database so the autouse
`clear_database` fixture can't wipe rows another worker is mid-test with:

- Rootdir `backend/conftest.py` sets a per-worker `DB_NAME`
  (`romm_test_gw0`, ...) before any app module is imported, so each
  worker's engine binds to its own database.
- `tests/conftest.py` creates the per-worker database on demand (mariadb/
  mysql and postgresql paths) just before migrations run.
- The test user's grant is widened to `*.*` (setup.sql + CI) so it can
  `CREATE DATABASE` for the workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:02:47 -04:00
Georges-Antoine Assi
959c9ac0bf refactor feeds file 2026-02-03 17:09:21 -05:00
Georges-Antoine Assi
24a5acce5d [ROMM-2552] Rom hashes should only include top-level nested files 2025-10-18 18:05:57 -04:00
Georges-Antoine Assi
6ddfd4e805 include empty config tests 2025-07-24 23:45:18 -04:00
Georges-Antoine Assi
877be2fe35 add test for roms handler 2025-07-17 17:38:56 -04:00
Georges-Antoine Assi
e4fdf70b63 make the tests real 2025-07-17 16:49:07 -04:00
Georges-Antoine Assi
374ae75688 fix tests 2024-02-02 17:09:45 -05:00
Georges-Antoine Assi
f3d44aae41 api endpoint for raw asset access 2024-01-18 09:48:57 -05:00
zurdi
e006b33007 fixed sql script testing setup 2023-08-11 10:00:47 +02:00
zurdi
282d36e9bb test db and user creation fixed and scripted 2023-08-03 12:32:45 +02:00
Georges-Antoine Assi
f49dd6494e Remove test resources 2023-08-01 15:28:45 -04:00
Georges-Antoine Assi
27f344b8de Add tests for fs 2023-08-01 15:27:59 -04:00
Georges-Antoine Assi
d3f818d4f5 Add tests for fastapi 2023-08-01 12:29:02 -04:00