Skip to content

Detailed code coverage and benchmarking support for golang #1690

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

Closed
Ankush-Goyal opened this issue Aug 14, 2021 · 8 comments
Closed

Detailed code coverage and benchmarking support for golang #1690

Ankush-Goyal opened this issue Aug 14, 2021 · 8 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Ankush-Goyal
Copy link

Is your feature request related to a problem? Please describe.

Can we implement a formal way of viewing code coverage like a gutter, highlight based and also percentage based for files.

Describe the solution you'd like
Gutter: it shows the lines of code covered by test cases on the left side similar to where debug points are shown

Highlight: shows the actual lines highlighted as different color codes

Percentage: shows a tabular format in percentages for folder as well as file level. Somewhat similar to how goland has done it.

Additional context
Goland supports a great ui for ease of testing. Just selecting option and it fires of the coverage. It would be great if we can get a similar feature in place.

Note: As per my research, vs code doesn't have something similar. Correct me if I am wrong and would help if you can provide a documentation or useful tutorial for it

@gopherbot gopherbot added this to the Untriaged milestone Aug 14, 2021
@hyangah
Copy link
Contributor

hyangah commented Aug 16, 2021

@Ankush-Goyal I am not sure about Percentage info yet, but Coverage info visulaization using Gutter/Highlight is already available. See https://github.com/golang/vscode-go/blob/master/docs/features.md#code-coverage and type of https://github.com/golang/vscode-go/blob/master/docs/settings.md#gocoveragedecorator.
If the current feature is insufficient, can you show the screenshot of goland vs vscode, and repro case?

cc @pjweinb

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 16, 2021
@Ankush-Goyal
Copy link
Author

@hyangah I created a small even odd program to show the usecase. Attaching the screenshot below for UI difference between goland and VScode. The current interface on vscode is like a terminal based detailing for test. Goland provides a user interface which is easily navigable for different type of use cases such as test, profiling etc.
Screenshot from 2021-08-18 07-19-11
Screenshot from 2021-08-18 07-23-51
Screenshot from 2021-08-18 07-34-28
Screenshot from 2021-08-18 07-41-34
Screenshot from 2021-08-18 07-49-11
Screenshot from 2021-08-18 07-49-13
Screenshot from 2021-08-18 07-49-17
Screenshot from 2021-08-18 07-49-29
Screenshot from 2021-08-18 07-49-32

Getting this implemented will improve user experience for golang developers.

@hyangah
Copy link
Contributor

hyangah commented Aug 20, 2021

Thanks. It looks like you want CPU profile support.

For gutter-style code coverage presentation, try https://github.com/golang/vscode-go/blob/master/docs/settings.md#gocoveragedecorator

@firelizzard18
Copy link
Contributor

FYI, VSCode is adding support for coverage to the testing API. See microsoft/vscode#123713 for details on the proposed API.

@Ankush-Goyal
Copy link
Author

@hyangah CPU profile support is one part to it. Benchmarking, testing race condition, Memory profiling, flamegraph these are some of the extra pointers I can say,. Still I would say Testing, Benchmarking, Memory and CPU profiling should be given importance for starters.

@firelizzard18
Copy link
Contributor

@Ankush-Goyal That is a very broad request; in Atlassian's terminology, I would call this an epic. If you break this down into multiple issues, one per feature (user stories), it would be much easier to address.

@firelizzard18
Copy link
Contributor

@Ankush-Goyal There is an existing plan (discussed on #1579) to add profiling of tests and benchmarks and a way to view those profiles as a flow graph. #1724 covers creating diff profiles and #1725 covers profiling main functions. If you want additional features, I recommend you create specific issues.

@hyangah
Copy link
Contributor

hyangah commented Nov 12, 2021

Closing. Thanks for sharing ideas. @Ankush-Goyal
As @firelizzard18 advised, please create specific issues.

@hyangah hyangah closed this as completed Nov 12, 2021
@golang golang locked and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants