photoprism/internal/entity/query
Michael Mayer 5efb48eb98 Tests: Fix the Go unit test suite on MariaDB #5753
Tables.Truncate stopped after the first table, so ResetTestFixtures never
cleared the database. SQLite hides this because every package gets its own
file, while on MariaDB all packages share the "acceptance" schema and state
leaked from one package into the next. It now clears every table, keeps the
schema migration state so a reset does not re-run all migrations, and prefers
TRUNCATE where supported so generated IDs match those of a fresh database.

run-test-mariadb passes -p 1, as go test would otherwise run one package per
CPU against that single schema.

The album filter folds the pattern before comparing it to album_slug, which is
VARBINARY and therefore case-sensitive on MySQL/MariaDB, so album:*Forrest no
longer depends on the database in use. Session fixtures use whole-second login
offsets, since a nanosecond difference rounds to the same DATETIME value and
left the login sort order undefined.

Tests that assumed SQLite now branch on the active driver, those that need a
database of their own also pin PHOTOPRISM_TEST_DRIVER, as a SQLite path alone
is parsed as a MySQL DSN and aborted the whole package, and FilesByUID rejects
a negative limit instead of relying on the SQLite parser to reject the query.
2026-07-25 18:06:04 +00:00
..
testdata/directory
account.go
account_test.go Test: Use PascalCase names for all Go subtests in /internal 2025-10-02 14:50:02 +02:00
account_uploads.go Services: Hold back DNG on WebDAV upload when raw sync is off #5744 2026-07-25 15:17:25 +00:00
account_uploads_test.go Services: Hold back DNG on WebDAV upload when raw sync is off #5744 2026-07-25 15:17:25 +00:00
albums.go Config: Centralize SQL driver identifiers in pkg/dsn #5588 2026-05-17 14:47:43 +00:00
albums_test.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
camera.go Metadata: Add Camera Make and Model updates via CLI & API #5663 #5656 2026-06-15 09:25:44 +00:00
camera_test.go Metadata: Add Camera Make and Model updates via CLI & API #5663 #5656 2026-06-15 09:25:44 +00:00
categories.go Query: Add code comments for easier troubleshooting #5235 2025-09-30 21:46:42 +02:00
categories_test.go
clients.go
clients_test.go
counts.go Query: Add code comments for easier troubleshooting #5235 2025-09-30 21:46:42 +02:00
counts_test.go
covers.go Config: Centralize SQL driver identifiers in pkg/dsn #5588 2026-05-17 14:47:43 +00:00
covers_test.go Tests: Improve isolation and add fixes #5263 2026-07-12 05:47:21 +02:00
duplicates.go
duplicates_test.go Test: Use PascalCase names for all Go subtests in /internal 2025-10-02 14:50:02 +02:00
errors.go
errors_test.go Test: Use PascalCase names for all Go subtests in /internal 2025-10-02 14:50:02 +02:00
faces.go Cleanup: Use US English spelling in code comments 2026-05-17 13:46:24 +00:00
faces_test.go Config: Centralize SQL driver identifiers in pkg/dsn #5588 2026-05-17 14:47:43 +00:00
file_selection.go Logging: Report backend internals on the console-only system log 2026-07-25 07:02:17 +00:00
file_selection_test.go Downloads: Add signed tokens and file-level album selection #5733 #5743 2026-07-24 15:55:39 +00:00
file_shares.go
file_shares_test.go Test: Use PascalCase names for all Go subtests in /internal 2025-10-02 14:50:02 +02:00
file_sync_download.go Index: Expanded folder-album reconciliation scope when needed #5437 2026-02-24 12:15:58 +01:00
file_sync_download_test.go Index: Expanded folder-album reconciliation scope when needed #5437 2026-02-24 12:15:58 +01:00
file_syncs.go
file_syncs_test.go Test: Use PascalCase names for all Go subtests in /internal 2025-10-02 14:50:02 +02:00
files.go Tests: Fix the Go unit test suite on MariaDB #5753 2026-07-25 18:06:04 +00:00
files_hashes.go Query: Add code comments for easier troubleshooting #5235 2025-09-30 21:46:42 +02:00
files_hashes_test.go
files_test.go Tests: Fix the Go unit test suite on MariaDB #5753 2026-07-25 18:06:04 +00:00
folders.go Config: Centralize SQL driver identifiers in pkg/dsn #5588 2026-05-17 14:47:43 +00:00
folders_test.go Test: Use PascalCase names for all Go subtests in /internal 2025-10-02 14:50:02 +02:00
label.go API: Add additional fields to label and subject edit forms #383 #3168 2025-01-17 02:55:07 +01:00
label_test.go Auth: Refactor cluster configuration and provisioning API endpoints #98 2025-09-24 08:28:38 +02:00
lens.go Metadata: Add Lens Make and Model updates via CLI & API #5644 #5656 2026-06-15 09:37:32 +02:00
lens_test.go Metadata: Add Lens Make and Model updates via CLI & API #5644 #5656 2026-06-15 09:37:32 +02:00
markers.go AI: Improve conflict resolution when merging face clusters #5167 2025-10-07 18:58:21 +02:00
markers_test.go AI: Improve conflict resolution when merging face clusters #5167 2025-10-07 18:58:21 +02:00
moments.go Moments: Dedup folder albums by filter, not slug #5615 #5614 2026-06-01 11:18:30 +00:00
moments_test.go Moments: Dedup folder albums by filter, not slug #5615 #5614 2026-06-01 11:18:30 +00:00
photo.go Index: Reassign primary when current primary is deleted #5625 2026-05-29 02:51:31 +00:00
photo_map.go Query: Add code comments for easier troubleshooting #5235 2025-09-30 21:46:42 +02:00
photo_map_test.go
photo_selection.go Photos: Limit by-UID and batch photo edits to the session scope 2026-06-10 19:49:27 +02:00
photo_selection_test.go Photos: Limit by-UID and batch photo edits to the session scope 2026-06-10 19:49:27 +02:00
photo_test.go Index: Reassign primary when current primary is deleted #5625 2026-05-29 02:51:31 +00:00
places.go Query: Add code comments for easier troubleshooting #5235 2025-09-30 21:46:42 +02:00
places_test.go
purge.go Metadata: Add Camera Make and Model updates via CLI & API #5663 #5656 2026-06-15 09:25:44 +00:00
purge_test.go Videos: Refactor codec, content and file type specifications #4770 2025-02-05 00:30:45 +01:00
query.go Links: Use canonical trailing-slash form for website URLs 2026-06-24 17:20:30 +02:00
query_test.go Tests: Fix the Go unit test suite on MariaDB #5753 2026-07-25 18:06:04 +00:00
sessions.go
sessions_test.go
subjects.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
subjects_test.go
users.go Metrics: Add file system and account usage info #5355 2025-11-30 10:43:58 +01:00
users_test.go Tests: Add unit tests #4973 2025-05-02 18:39:40 +02:00