Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Show test coverage when test(s) fail. #2193

Closed
jpap opened this issue Dec 18, 2018 · 1 comment
Closed

Show test coverage when test(s) fail. #2193

jpap opened this issue Dec 18, 2018 · 1 comment

Comments

@jpap
Copy link

jpap commented Dec 18, 2018

I'm manually porting an existing large/complex codebase to Go and am using failed test cases to work out where there is a mismatch in implementation. In doing so, it helps to look at the code path of a failed test.

As the codebase is large, it helps to use the code coverage feature to limit the manual visual diff when failures occur.

Unfortunately, however, vscode-go does not show code coverage when the test fails, despite Go producing the coverprofile file. A workaround is to force tests to pass by removing test assertions, but this is time-consuming. This took me an hour to work out: I was especially puzzled as to why no code coverage was shown, despite the GOPATH looking OK and the coverprofile file being generated OK.

Can we include failed tests into the code coverage?

@ramya-rao-a
Copy link
Contributor

I dont believe there is any reason why we shouldnt show the coverage if Go generates the coverprofile file.

PRs are most welcome.
Code Pointers:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants