Commit Graph

567 Commits

Author SHA1 Message Date
Claudio Ortolina 78487b0085 Pin Wikipedia intro_html to fixture value
Map.has_key? verified the key existed but not the content. The
fixture is deterministic — assert the stored value equals
Wikipedia.Fixtures.article_extract_html/0.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina a6319d55df Pin artist_live/show image_data_hash assertions
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 07c99992a3 Pin barcode_scan release assertions
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 162c10e70a Pin fetch_artist_image asset lookup
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina bce8560ce8 Pin fetch_artist_info stored-data assertions
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 1f457f0f11 Pin prune_assets test to %Asset{hash: ^hash} match
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 8a6c688a56 Assert parsed audit JSON structure
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 0eabe4b3ab Assert import count > 0 in options-forwarding test
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 8ce5da65e2 Pin Brave search error body assertion
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina cedb86af5d Pin OpenAI API error assertions to their shapes
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 6adfbea336 Pin Records.populate_genres error to OpenAI prefix
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 0ee0dcb118 Match decoded OpenAI error body, not raw JSON
Switch the 500-response stubs to Req.Test.json so Req decodes the
body, then match the map shape. Avoids coupling the assertion to
the exact JSON serialization.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 1429f7a826 Drop tautological delete.id checks
Repo.delete always returns the struct it was given, so deleted.id
== original.id is trivially true. Thread deleted.id through the
trailing get_*! call instead, so the binding is load-bearing.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina bb260437a1 Pin populate_genres error to OpenAI prefix
Match the string prefix "OpenAI API error:" that propagates from
OpenAI.gpt on non-2xx responses.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina a841ccf8e8 Tighten generate_record_embedding assertions
Assert stored embedding text matches the representation helper.
Pin the OpenAI-500 error path to the raw JSON body string.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina bbe0d5cd9e Pin artist_refresh_discogs_data assertions
Bind the returned ArtistInfo. For the no-discogs branch, assert
discogs_data was not touched.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina f9e3e8c5f8 Pin artist_refresh_wikipedia_data assertions
Bind perform_job results and assert id equality. For the unchanged case,
also assert wikipedia_data is the same as before the job ran.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 914fb4fbee Match specific errors on scrobble_rules duplicate
Pin the duplicate-rule error to the match_value field and "has already been
taken" message, matching the unique_constraint error_key in the changeset.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 9e29de55aa Pin online_store_templates delete assertion
Assert deleted.id == template.id rather than wildcard-matching the
returned struct.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina a90fdcf82f Tighten chats assertions
Pin invalid-attrs error to specific field, assert collection UUID round-trips
through Ecto.UUID.cast unchanged, and assert deleted.id == chat.id on delete.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 66c36f4d09 Tighten record_sets delete and duplicate assertions
Assert deleted.id == set.id on delete, and pin the duplicate error to the
specific field and message from the unique_constraint on record_set_id.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 60e95804ad Tighten similarity test assertions
Bind returned embeddings and assert record_id / text_representation match.
Pin OpenAI error path to the actual raw string body returned by the stub.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina e0fe5051ec Pin asset dedup assertion to same-hash
The duplicate prevention test asserted `{:ok, _}` twice without checking
that both calls returned the same asset. Assert hash equality.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina ae036e79fb Tighten scrobble_activity assertions
Replace 9 `{:ok, _}` sites with specific response-body checks to verify
the context returns the Last.fm API payload and not just the success branch.

Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina beaf38fcfe Add record_release tests 2026-04-19 16:11:32 +01:00
Claudio Ortolina 0dcfecf741 Increase render_async timeout to cater for slower CI 2026-04-19 09:29:04 +01:00
Claudio Ortolina f4db063298 Test artist edit form and record set picker flows
Closes #180
2026-04-19 09:00:06 +01:00
Claudio Ortolina 45236e4b10 Convert ErrorIgnorer tests to doctests 2026-04-19 07:50:39 +01:00
Claudio Ortolina 06ae5f8271 Share recent tracks fixture between Last.fm tests 2026-04-19 07:50:15 +01:00
Claudio Ortolina 22a47f4ca9 Add tests for previously uncovered modules 2026-04-19 07:47:20 +01:00
Claudio Ortolina 94143010c0 Fix doubly-wrapped safe tuple in artist bio render 2026-04-17 16:00:22 +01:00
Claudio Ortolina fd6eab82c0 Track fixture files as external resources 2026-04-17 14:02:45 +01:00
Claudio Ortolina 079f2a5f0f Add BraveSearch facade tests 2026-04-17 13:57:36 +01:00
Claudio Ortolina d8d5524e41 Replace Process.sleep with sys.get_state in error notifier tests
Deterministic GenServer state polling instead of timing-based waits.
Fixes #169.
2026-04-17 12:58:50 +01:00
Claudio Ortolina 4c5a3393e2 Run query reporter tests with async false
Avoid getting spurious failures due to interference by other tests
2026-04-17 10:29:43 +01:00
Claudio Ortolina 90838d1a3f Add tests for RecordActions and Chat component
Covers all action handlers on LiveHelpers.RecordActions and all
update/event clauses on Components.Chat — including streaming
chunk/done/error transitions and the retry re-send path.

Closes #179
2026-04-17 07:01:07 +01:00
Claudio Ortolina c816f2de4a Add scrobbled tracks search parser
Introduces ListeningStats.SearchParser with NimbleParsec supporting
record:, album_mbid:, artist_mbid:, artist:, album:, track: filters.
Links scrobble count on record page to filtered scrobbled tracks view.
2026-04-15 14:56:38 +01:00
Claudio Ortolina 851cb36858 Fix dl accessibility violations on stats dashboard 2026-04-15 14:16:24 +01:00
Claudio Ortolina 405235e2b3 Add picker to create scrobble rules on the fly 2026-04-15 10:53:58 +01:00
Claudio Ortolina b9612a2a26 Fix records on this day for partial release dates
SQLite interprets bare years (e.g. "1970") as Julian day numbers
in strftime, producing wrong month-day matches. Filter to only
full YYYY-MM-DD dates before comparing.
2026-04-15 07:29:58 +01:00
Claudio Ortolina dd3bb47989 Add tests for mixed collected/wishlisted matching records 2026-04-14 16:07:14 +01:00
Claudio Ortolina 2c6e6e7ca2 Return matching_records list from top_albums_attach_metadata
Apply the same release-group JSON aggregation pattern to top albums
queries. Add JSON parsing in get_top_albums/1 and
get_top_albums_by_days/2.
2026-04-14 16:05:51 +01:00
Claudio Ortolina cfd267627c Return matching_records list from tracks_with_record_info_query
Replace scalar collected_record_id/wishlisted_record_id subqueries with
a single matching_records JSON array grouped by release group
(records.musicbrainz_id). Add parse_matching_records/1 for JSON parsing
and derive_legacy_record_ids/2 as a temporary bridge for existing
templates. Update tests to use shared musicbrainz_id fixtures.
2026-04-14 14:17:02 +01:00
Claudio Ortolina 9f4135661e Replace scalar record IDs with matching_records JSON array in tracks query
Replaces collected_record_id and wishlisted_record_id correlated
subqueries in tracks_with_record_info_query with a single
matching_records json_group_array subquery that returns all records
sharing the same release ID. Adds parse_matching_records/1 for JSON
deserialization. Updates recent_activity/2 and list_tracks/1 to parse
the JSON at the boundary. Derives legacy collected_record_id and
wishlisted_record_id from matching_records so existing LiveViews keep
working. The get_top_albums test is temporarily skipped pending the
top_albums_attach_metadata update.
2026-04-14 14:12:14 +01:00
Claudio Ortolina 6a6410bcaa Have the LLM use square bracketed links for internal references 2026-04-13 14:24:36 +01:00
Claudio Ortolina e10df1985e Reuse binding in test 2026-04-13 13:34:23 +01:00
Claudio Ortolina b422cccf09 Make format merge assertion order-independent 2026-04-13 13:17:03 +01:00
Claudio Ortolina 726b7d5ef8 Add tests for chat auto-open via query param 2026-04-13 13:16:28 +01:00
Claudio Ortolina bdc1cd3992 Prevent callback return value from halting stream
The delta branch in decode_responses_event now explicitly returns
:ok after invoking the callback, so a callback returning {:error, _}
cannot be mistaken for a stream-level error by decode_events.
2026-04-13 13:14:33 +01:00
Claudio Ortolina 846b92fd4c Add tests for streaming error events in OpenAI.API
Covers error event mid-stream, response.failed events, halt
behavior after errors, and unexpected event type logging.
2026-04-13 13:13:51 +01:00