akoutmos / doctor

Ensure that your Elixir project documentation is healthy
MIT License
180 stars 15 forks source link

Feature Request - Show overall coverage for umbrella project #12

Closed cohawk closed 4 years ago

cohawk commented 4 years ago

excoveralls has a --umbrella flag which combines the output and calculates the total coverages from all child apps into one coverage report. Helps much with CI/CD instead of just scraping the coverage % from only the last child app.

Could that be added as a Doctor.Reporters option easily?

Cheers!

akoutmos commented 4 years ago

Hello and thanks for reaching out! This def sounds like something I can add in to doctor. Just to make sure I understand your use case correctly, would this be just for the coverage reports, or would you also like to see this flag impact the min_overall_*_coverage values. iirc those values are currently evaluated on a per-umbrella app basis, so that would require some tweaking.

Let me know your thoughts and we'll take it from there. Thanks!

cohawk commented 4 years ago

Ahh yes, I believe it would help to have the min_overall_*_coverage values be calculated against the sum of all the umbrella apps values in order to properly flag a PASS / FAIL in CI/CD.

Thank you for the reply...and the library!

akoutmos commented 4 years ago

I'll try and put something together and tag you in the PR for some input. Thanks for the input :)

akoutmos commented 4 years ago

@cohawk I have PR #13 up and from my tests it looks like it does what you requested. If you wouldn't mind validating for me (since I don't have a lot of real world umbrella apps to test against), could you change your mix.exs doctor dep to: {:doctor, git: "https://github.com/akoutmos/doctor", branch: "umbrella_flag"} and then run mix doctor --umbrella to make sure things look right?

Thanks!

cohawk commented 4 years ago

@akoutmos tested and that looks identical to the output I mocked up, except you added the umbrella root name - nice touch!

Gitlab CI/CD Pipeline picked up the total coverage percentage as well.

also tested on a much older Umbrella repo - https://github.com/cohawk/ticker_umbrella - and while the app itself no longer runs, it still compiles and displays the mix doctor and mix doctor --umbrella output correctly with your branch: "umbrella_flag"

thank you VERY much for taking the time to add this!!

akoutmos commented 4 years ago

Glad that it worked as expected :). And thanks for the feature suggestion!

I have 2 additional features I want to get into the next release, so I may delay a day or two until tagging the next version. I'll drop you a message here once the release is cut.

akoutmos commented 4 years ago

@cohawk Version 0.12.0 has been published to Hex https://hex.pm/packages/doctor. Check out the changelog for all the additional features that made it into the release. Thanks for the feedback again and enjoy!