-
-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go: add support for test coverage #16550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
) | ||
|
||
_coverage_output_dir = StrOption( | ||
default=str(PurePath("{distdir}", "coverage", "go", "{import_path_escaped}")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... I'm surprised that you need this prefix... I guess that the test
goal doesn't add it?
IIRC, @benjyw refactored the report output location to have a default, which would probably be reasonable to do here too if it makes things easier for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test
goal does not influence the output location. I based this code on the option code in the Python backend which supplies the path prefix itself. See
pants/src/python/pants/backend/python/goals/coverage_py.py
Lines 150 to 154 in 28d756e
_output_dir = StrOption( | |
default=str(PurePath("{distdir}", "coverage", "python")), | |
advanced=True, | |
help="Path to write the Pytest Coverage report to. Must be relative to the build root.", | |
) |
[ci skip-rust] [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
of the test package only and `go` leaves this value blank in that case [ci skip-rust] [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
74d7be4
to
c47c486
Compare
Update the Go backend to gather code coverage data for packages under test. The coverage files are written under `dist/coverage/go/IMPORT_PATH` directories (where `IMPORT_PATH` has slashes escaped to underscores). The coverage output is the raw `cover.out` format from the `go` tooling and is not rendered by this PR (which can be done in a follow-on since it is a bit involved). [ci skip-rust] [ci skip-build-wheels]
Update the Go backend to gather code coverage data for packages under test. The coverage files are written under
dist/coverage/go/IMPORT_PATH
directories (whereIMPORT_PATH
has slashes escaped to underscores). The coverage output is the rawcover.out
format from thego
tooling and is not rendered by this PR (which can be done in a follow-on since it is a bit involved).[ci skip-rust]
[ci skip-build-wheels]