Commit Graph

34 Commits

Author SHA1 Message Date
Claudio Ortolina 5c5a523fe6 Move scrobble refresh infra to Oban 2026-03-28 09:00:18 +00:00
Claudio Ortolina 61dd3f45c7 Move refresh config and callers to ListeningStats 2026-03-27 23:14:09 +00:00
Claudio Ortolina e575f2af9e Stub color extractor in tests
Makes the test suite much faster
2026-03-26 22:58:39 +00:00
Claudio Ortolina 152b3ddb70 Tweak test database settings for speed 2026-03-26 22:30:09 +00:00
Claudio Ortolina 0295e58e57 Add rate limiting to Wikipedia and BraveSearch APIs
Closes #133
2026-03-25 11:38:17 +00:00
Claudio Ortolina b215d23ff1 Increase parallelism and tolerance for tests (CI particularly) 2026-03-22 08:11:15 +00:00
Claudio Ortolina 0f0d90d84e Increase busy_timeout in test to avoid intermittent failures on CI
Running ExUnit with seed: 849711, max_cases: 4

........................................................................................................................................................................................................................................................................................................................................................................................................................................................

  1) test count_record_sets/0 and count_record_sets/1 returns total count (MusicLibrary.RecordSetsTest)
Error:      test/music_library/record_sets_test.exs:97
     ** (Exqlite.Error) Database busy
     INSERT INTO "record_sets" ("name","description","inserted_at","updated_at","id") VALUES (?1,?2,?3,?4,?5)
     code: record_set(%{name: "One"})
     stacktrace:
       (ecto_sql 3.13.5) lib/ecto/adapters/sql.ex:1113: Ecto.Adapters.SQL.raise_sql_call_error/1
       (ecto 3.13.5) lib/ecto/repo/schema.ex:1000: Ecto.Repo.Schema.apply/4
       (ecto 3.13.5) lib/ecto/repo/schema.ex:500: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
       (music_library 0.1.0) lib/music_library/record_sets.ex:71: MusicLibrary.RecordSets.create_record_set/1
       (music_library 0.1.0) test/support/fixtures/music_library/record_sets.ex:16: MusicLibrary.Fixtures.RecordSets.record_set/1
       test/music_library/record_sets_test.exs💯 (test)

................................................................................................................................
Finished in 25.5 seconds (3.4s async, 22.1s sync)
37 doctests, 532 tests, 1 failure
2026-03-17 14:02:57 +00:00
Claudio Ortolina f109057be5 Persist telemetry data in local sqlite database 2026-03-05 13:39:38 +00:00
Claudio Ortolina 1c04eea88f Install and configure Swoosh with Mailgun 2026-03-04 15:52:17 +00:00
Claudio Ortolina 99674eb8bc Refactor and add tests for OpenAI namespace 2026-03-02 14:11:51 +00:00
Claudio Ortolina a95648c25d Support running parallelized test suites 2026-03-02 10:51:59 +00:00
Claudio Ortolina 919a42d355 Parameterize API cooldowns 2026-03-01 17:17:32 +00:00
Claudio Ortolina ddc4691522 EXP: cover search via Brave API 2026-02-09 18:51:47 +00:00
Claudio Ortolina bcae291cff Support getting artist bios from Wikipedia (experimental) 2026-02-09 15:20:06 +00:00
Claudio Ortolina 42fc59f111 Update dependencies
ecto_sql 3.13.2 => 3.13.3
phoenix 1.8.2 => 1.8.3
phoenix_live_reload 1.6.1 => 1.6.2
2025-12-08 19:49:09 +00:00
Claudio Ortolina 57dfd3d33d Remove ErrorTracker
Doesn't work with recent LiveView releases, and seems to be maintained
very slowly despite incoming PRs to fix the issues.
2025-10-03 10:15:23 +03:00
Claudio Ortolina 635b2fb9b5 Remove fast_html
Started showing some errors during test:

fast_html worker: error: Failed to write response to stdout
2025-05-05 08:04:01 +01:00
Claudio Ortolina 2c57f9bf65 Add Discogs module 2025-04-25 18:09:43 +01:00
Claudio Ortolina c44fcc7321 Install Oban with dedicated repo 2025-04-13 18:09:53 +01:00
Claudio Ortolina 15c20f6803 Use fast_html for tests
Gives a visible speed bump: on a M1 machine tests go from 1.7s to 1.2s
2025-03-23 08:16:39 +00:00
Claudio Ortolina a218942110 Remove mox in favour of built-in Req stubs 2025-02-28 16:41:16 +00:00
Claudio Ortolina 3d11cd585d Use built-in Req stub for LastFm tests 2025-02-27 13:43:49 +00:00
Claudio Ortolina 4a8a37a52f Tighten up monitoring routes configuration 2025-01-28 11:49:45 +00:00
Claudio Ortolina eeaaf8b542 Move ErrorTracker to its own repo and file
Note that the SQlite adapter supports version 2 onwards.
2025-01-23 10:40:36 +00:00
Claudio Ortolina 04f5c6e5a1 Rewrite LV tests using PhoenixTest 2025-01-05 11:29:33 +00:00
Claudio Ortolina 61cda5a62c Explicitly set auto-refresh config for LastFm refresh 2024-12-03 19:58:17 +00:00
Claudio Ortolina f58a5e83b7 Revert "Reduce pool size in test"
This reverts commit 7a26b6bda6.
2024-12-03 19:42:52 +00:00
Claudio Ortolina 7a26b6bda6 Reduce pool size in test
Due to SQLite having one single write transaction, database tests cannot
be executed async, making a large pool ineffective at best. A setting of
10 is enough for those tests where we perform multiple read operations
(which tend to be sequential anyway).

Test execution time before and after this change remains effectively the
same.
2024-11-30 22:41:56 +00:00
Claudio Ortolina 3facdcb5bd Compile dev routes in test
As the route is rendered in the stats page, it needs to be enabled in
all Mix environments in order to avoid compile time warnings.
2024-11-29 15:26:59 +00:00
Claudio Ortolina 18ae8b7866 Refactor last_fm configuration
Move all configuration outside of the LastFm module, so that it's not
polluted with references to the parent music_library application.
2024-11-06 12:09:38 +00:00
Claudio Ortolina d818cdbae5 Don't run LastFm.Feed in tests 2024-11-04 09:45:05 +00:00
Claudio Ortolina e4c0ce58f6 Increase test pool size to avoid resource contention 2024-10-08 20:37:28 +01:00
Claudio Ortolina 94ca2ab625 Move databases into /data 2024-10-07 08:12:05 +01:00
Claudio Ortolina d547ee6f8d Generate project
Using `mix phx.new music_library --database sqlite3 --binary-id --no-mailer`
2024-09-12 14:05:08 +01:00