Commit Graph

40 Commits

Author SHA1 Message Date
Georges-Antoine Assi
de63580fcf trunk fmt everything 2026-07-19 20:35:51 -04:00
Georges-Antoine Assi
c9779a6302 Stop spamming PRs with coverage reports 2026-06-28 22:13:57 -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
Claude
95958b6687 test: integrate Hypothesis property-based testing for backend
Add Hypothesis to the test dependency group with CI/dev profiles, and
introduce property-based tests for high-value pure functions: crc32_to_hex,
filesystem and LaunchBox filename sanitization, LaunchBox metadata parsers,
and ROM filename tag parsing.

https://claude.ai/code/session_01GCTFmzuhvqNbSAfw3rGxmj
2026-05-21 16:40:04 +00:00
zurdi
a18fd9c459 fix: remove conditional check for mariadb connectors installation 2026-03-20 13:43:47 +00:00
Georges-Antoine Assi
2f7f6f65e7 run tests against postgres matrix 2026-03-08 10:20:09 -04:00
Georges-Antoine Assi
e79204ee4a continue-on-error: true in pytest publish report step 2026-02-03 09:22:09 -05:00
Georges-Antoine Assi
743bddcb23 add valkey to pytest ci 2026-01-10 09:22:46 -05:00
Georges-Antoine Assi
91fb6f6f23 initialize field 2025-09-23 18:23:08 -04:00
Georges-Antoine Assi
92ca3d899c pin docker uses to immutable versions 2025-09-18 10:02:54 -04:00
Georges-Antoine Assi
2e047e41ce actually generate coverage file 2025-07-06 09:32:38 -04:00
Georges-Antoine Assi
7cdc42e307 use coverage from bckend 2025-07-06 09:16:37 -04:00
Georges-Antoine Assi
b797e63fdf augment pytest with coverage 2025-07-05 23:20:52 -04:00
Georges-Antoine Assi
d30e1cfa91 Apply suggestion from @adamantike
Co-authored-by: Michael Manganiello <adamantike@users.noreply.github.com>
2025-07-04 21:22:35 -04:00
Georges-Antoine Assi
e8f8f1621c complete migration to uv 2025-07-04 09:54:04 -04:00
Michael Manganiello
f96adeeaee misc: Upgrade to Python 3.13
Small changes to upgrade Python to version 3.13, and fixes based on a
`pyupgrade` run using the `--py313-plus` flag.
2025-07-03 23:37:00 -03:00
Michael Manganiello
56631db636 fix: Poetry dependency installation during pytest job
With Poetry 2.0, we now need to explicitly tell it to install the `test`
extra.
2025-01-13 09:43:22 -03:00
Georges-Antoine Assi
6e912054ac Expand list of non-hashable platforms 2024-12-22 21:39:06 -05:00
Michael Manganiello
0fdbbe4625 misc: Upgrade Python to v3.12 and Alpine to v3.20
Included upgrades:
* Python: v3.12
* Alpine: v3.20 (which uses Python 3.12)
* nginx: v1.27.1
2024-08-15 20:14:32 -03:00
Georges-Antoine Assi
ebe570d92d Fix to AdditionalContent types 2024-08-04 22:23:48 -04:00
Michael Manganiello
3d4a66cbca misc: Remove mentions to unneeded Poetry mention
Poetry 1.8.0 already includes support for `package-mode = false`, so
there's no need to install a Poetry fork anymore.
2024-06-24 07:38:27 -03:00
Georges-Antoine Assi
847606877d add task to run in CI 2024-05-24 17:50:14 -04:00
Georges-Antoine Assi
2a980a04e6 last bits of fixes 2024-05-21 17:52:13 -04:00
Georges-Antoine Assi
a7cf0d389a run trunk format on all files 2024-05-21 10:18:13 -04:00
Georges-Antoine Assi
e62ef192dc Bump python to 3.11 + packages 2024-03-17 00:23:48 -04:00
Georges-Antoine Assi
dc0f61041e update build script 2024-02-10 10:20:30 -05:00
Zurdi
72ff2b1ebe removed npm suffix from poetry command 2023-12-13 18:01:09 +01:00
Zurdi
ef3b765be3 removed wrong cd 2023-12-13 16:14:44 +01:00
Zurdi
cf7ca9ae87 fixed symlink path 2023-12-13 16:12:23 +01:00
Zurdi
8e7b126646 symlink to poetry_npm 2023-12-13 15:55:10 +01:00
Zurdi
6702f3eab7 reverted poetry commands in workflow 2023-12-13 15:51:38 +01:00
Zurdi
e4b38213df fixed poetry binary 2023-12-13 15:50:50 +01:00
Zurdi
efd87a5e18 fixed test workflow 2023-12-13 15:44:09 +01:00
Zurdi
0c51585fc6 adapted workflows to poetry_npm 2023-12-13 15:40:51 +01:00
Zurdi
808279b2cd get branch_name and version from backend 2023-12-13 10:43:00 +01:00
Georges-Antoine Assi
22dec93071 Revert romm_version file 2023-08-10 21:21:06 -04:00
zurdi
ba10a48b21 added set version step to pytest workflow 2023-08-09 21:28:24 +02:00
zurdi
c884b869be build romm workflow renamed 2023-08-04 11:13:56 +02:00
Georges-Antoine Assi
f0e85df85f Add pytest for PRs
Install poetry explicit
2023-08-03 22:58:11 -04:00