Configure test coverage and enable on CI
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user