Files
music_library/backlog/archive/tasks/ml-68 - Random-data-in-test-fixtures.md
T
2026-04-20 10:02:25 +01:00

1.3 KiB

id, title, status, assignee, created_date, labels, dependencies, references, priority
id title status assignee created_date labels dependencies references priority
ML-68 Random data in test fixtures To Do
2026-04-20 08:55
https://github.com/cloud8421/music_library/issues/107
low

Description

GitHub: created 2026-03-12 · updated 2026-04-09 · closed 2026-03-16 · not planned

Description

Test fixtures use non-deterministic random values, which can make test failures harder to reproduce:

  • test/support/fixtures/music_library/records.ex:74Enum.random(@artists)
  • test/support/fixtures/music_library/records.ex:86Enum.take_random(@genres, :rand.uniform(3))
  • test/support/fixtures/music_library/records.ex:91Enum.random(@titles)
  • test/support/fixtures/music_library/records.ex:93Enum.random(Record.formats())
  • test/support/fixtures/music_library/records.ex:95Enum.random(1969..2024)
  • test/support/fixtures/scrobbled_tracks_fixtures.ex:16Enum.random(0..86_400)

Previously tracked in #85 (closed) but the randomness remains.

Expected behavior

Use deterministic sequences (e.g., based on System.unique_integer) or seeded randomness for reproducible tests.

Source

From technical debt audit (2026-03-12). Residual from #85.