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
+1 -1
View File
@@ -143,7 +143,7 @@ jobs:
- name: 🔮 Compile for TEST - name: 🔮 Compile for TEST
run: mix compile run: mix compile
- name: 🧪 Run tests - name: 🧪 Run tests
run: mix test --max-cases 8 run: mix test --cover --export-coverage ci-run --max-cases 8
deploy: deploy:
name: Deploy name: Deploy
+20
View File
@@ -13,10 +13,30 @@ defmodule MusicLibrary.MixProject do
deps: deps(), deps: deps(),
compilers: [:phoenix_live_view] ++ Mix.compilers(), compilers: [:phoenix_live_view] ++ Mix.compilers(),
listeners: [Phoenix.CodeReloader], listeners: [Phoenix.CodeReloader],
test_coverage: [
ignore_modules: ignored_coverage_modules(),
summary: [threshold: 75]
],
usage_rules: usage_rules() usage_rules: usage_rules()
] ]
end 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. # Configuration for the OTP application.
# #
# Type `mix help compile.app` for more information. # Type `mix help compile.app` for more information.