Configure test coverage and enable on CI

This commit is contained in:
Claudio Ortolina
2026-04-17 13:30:04 +01:00
parent d8d5524e41
commit 028c2a1b8d
2 changed files with 21 additions and 1 deletions
+20
View File
@@ -13,10 +13,30 @@ defmodule MusicLibrary.MixProject do
deps: deps(),
compilers: [:phoenix_live_view] ++ Mix.compilers(),
listeners: [Phoenix.CodeReloader],
test_coverage: [
ignore_modules: ignored_coverage_modules(),
summary: [threshold: 75]
],
usage_rules: usage_rules()
]
end
# Modules excluded from coverage accounting: cron-only workers that run
# operations incompatible with the Ecto sandbox (VACUUM / OPTIMIZE outside a
# transaction) or whose behaviour beyond a delegate call is untestable, and
# all Mix tasks (developer tooling not exercised by the application test
# suite).
defp ignored_coverage_modules do
[
MusicLibrary.Worker.RepoVacuum,
MusicLibrary.Worker.RepoOptimize,
MusicLibrary.Worker.SendRecordsOnThisDayEmail,
MusicLibrary.Worker.RefreshScrobbles,
MusicLibrary.Worker.BackfillScrobbledTracks,
~r/^Mix\.Tasks\./
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.