parroty / excoveralls

Coverage report tool for Elixir with coveralls.io integration.
MIT License
820 stars 178 forks source link

allow subdir and rootdir to be applied to all tasks and always apply to paths #289

Closed SamHutchings closed 1 year ago

SamHutchings commented 1 year ago

Hi,

TL;DR This PR allows the subdir and rootdir options to be used for all types of coverage generation, and always applies the option to the file paths, whether the umbrella flag is true or not.

The context for the change is that we (@duffelhq) have an umbrella application, but during CI runs tests for each app are run in parallel using mix cmd. We wanted to be able to append the app path (e.g. apps/example) to the relative path (e.g. lib/file.exs). However, this option was only available when using coveralls.post, so this PR allows it for all types. We use CircleCI, but I reckon this'd be useful for any CI server, and even when using json or local.

The subdir and rootdir were also previously only used when passing the umbrella flag - I've also made an update to respect these flags whether using umbrella or not.

Any suggestions on alternative methods welcome - I did consider incuding another setting, something like base_reporting_path, but it seemed like subdir/rootdir were what I was looking for. I may be missing some context, however.

coveralls commented 1 year ago

Coverage Status

Coverage decreased (-0.02%) to 90.467% when pulling 7665099249155b8ec11bdb8c9486a01cba63aa27 on duffelhq:always-allow-subdir-rootdir into d715fb219de5ff4b77fe0cad4bdaa75352c11a8a on parroty:master.

parroty commented 1 year ago

Thank you for the PR!