https://pantsbuild.org/ logo
#general
Title
# general
i

incalculable-yacht-75851

02/24/2022, 9:28 PM
Is it possible to run coverage reports and return an exit code if a threshold is not met? I'd like to have test goal fail based on a percent configured per test target.
h

hundreds-father-404

02/24/2022, 9:30 PM
https://www.pantsbuild.org/docs/reference-coverage-py#section-fail-under It'd be very appreciated if you wanted to try adding a small callout about this to https://www.pantsbuild.org/docs/python-test-goal#coverage as well. To suggest edits, click the button in the top right corner. Doesn't need to be perfect, we can help edit 🙂
i

incalculable-yacht-75851

02/24/2022, 9:32 PM
Awesome. Thanks, Eric. What we've done in our Go applications is save coverage to a file and parse it with perl.
I should note we currently only have python & shell test targets. We may have Go & Scala soon. Having this for python is what I need atm... but may need it for other languages in the future.
👍 1
h

hundreds-father-404

02/24/2022, 9:36 PM
Go and Scala don't yet have coverage support - please do feel free to open up feature requests at https://github.com/pantsbuild/pants/issues/new/choose 🙂 especially helpful is sharing how you're doing it now. Usually the hardest part of new features is scoping out how to do it w/o Pants - it's fairly mechanical to port after that
shell test targets.
This makes me so happy to hear you're using Shell test support! I'd love to hear more about that - for example, did you have tests before using Pants?
i

incalculable-yacht-75851

02/24/2022, 9:40 PM
we are going to be porting over the shell script over to python because it's less than ideal. Too many edge cases to cover. It was more of a proof of concept than anything else.
h

hundreds-father-404

02/24/2022, 9:41 PM
Interesting. What challenges are you running into?
i

incalculable-yacht-75851

02/24/2022, 9:49 PM
primarily readability.
👍 1
f

fast-nail-55400

02/24/2022, 9:51 PM
4 Views