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: support the go test
profiling options
#17836
Conversation
@@ -540,6 +593,11 @@ async def run_go_tests( | |||
pkg_target_address=field_set.address, | |||
) | |||
|
|||
output_files = [x for x in output_files if x != "cover.out"] | |||
if output_files: | |||
# TODO: What is the best way to arrange for these files to be output? |
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.
@benjyw / @Eric-Arellano: The remaining question in this PR is how exactly should ancillary profile files be written to disk?
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.
(given that the rule returns TestResult
). The extra_output
attribute does not appear to be used at all to write output out?
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.
hmm looks like it is written out
pants/src/python/pants/core/goals/test.py
Lines 852 to 855 in 4dc2d02
workspace.write_digest( | |
result.extra_output.digest, | |
path_prefix=str(distdir.relpath / "test" / result.path_safe_description), | |
) |
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.
Latest commit just has the profiles be extra output from the test run.
go test
profiling optionsgo test
profiling options
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.
It's nice when the standard test runner handles profiling rather than a mishmash of external tools!
Support the
go test
profiling options which take various profiles of a test run (e.g., CPU, memory, etc.). The profiles are output via theextra_output
field onTestResult
. Also includes the ability to export the compiled test binary (which is needed for analysis of some of the profiles).Closes #16610.