Move more fixtures to compile time

This commit is contained in:
Claudio Ortolina
2026-02-16 10:30:14 +00:00
parent 2f7e2caa3c
commit c7285a2f80
4 changed files with 44 additions and 40 deletions
+6 -5
View File
@@ -1,9 +1,10 @@
defmodule MusicBrainz.Fixtures.Artist do
@fixtures_folder Path.join([File.cwd!(), "test/support/fixtures/music_brainz"])
def get_artist do
Path.join([@fixtures_folder, "artist - steven wilson.json"])
|> File.read!()
|> JSON.decode!()
end
# Cache fixtures at compile time to avoid repeated file I/O
@get_artist Path.join([@fixtures_folder, "artist - steven wilson.json"])
|> File.read!()
|> JSON.decode!()
def get_artist, do: @get_artist
end