-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/cover: inconsistent NumStmt when //line clauses are used with Go 1.13.4 #35781
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
Comments
The problem seems to be that the cover tool assumes that all lines in a single input file correspond to a single input file. In this case the input file datemath.y.go is composed of different input files. The coverage tool is assigning some coverage information to line 89 of datemath.y and some to line 89 of yaccpar. The first problem is that the coverage information for those two different lines is being mixed together. The second more immediate problem is that line 89 of yaccpar is a for statement with multiple statements on the line, and line 89 of datemath.y is not. That causes the cover tool to report an inconsistency. I think the correct fix has to involve somehow making the cover tool aware of multiple source files within a single input file. Or, alternatively, entirely ignoring |
This was working in Go 1.12, and now not in 1.13, so what changed? Is this a bug in how goyacc makes line number comments or in how go cover treats them? |
I'm not sure. Want to look into it? |
Sure, I'll see what I can do.
…On Fri, 13 Dec 2019, 03:09 Ian Lance Taylor, ***@***.***> wrote:
I'm not sure. Want to look into it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#35781?email_source=notifications&email_token=AAXFX67AOXOUAVB6VUQZZHTQYJOZ7A5CNFSM4JQTMWHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGXFF2Y#issuecomment-565072619>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXFX6644LV6FC3BO6TJ5FLQYJOZ7ANCNFSM4JQTMWHA>
.
|
Moving this to Go1.16. |
Punting to Backlog |
On amd64, linux unit test runs, code coverage will be collected and uploaded to the coveralls coverage service on runs with the master branch. This does not include forks or PRs from community members. Currently, the coveralls service requires a token to be used to upload all coverage reports. However, there is no safe/secure way with circle ci to hide this with our current processes that we have in place. This also removes the coverage for the parsers/influx/machine.go file as it contains many "//line" comments which currently break reports. See golang/go#35781 for more details. fixes: influxdata#10733
This seems to be the same as #27350 but still happens even after running
go fmt
which was the recommended fix in that issue (and also in a release that includes d689946 which was intended to mitigate it).Removing all
//line
comments from the file allows it to pass.What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Using this repo, which uses
goyacc
to generatedatemath.y.go
, https://github.com/timberio/go-datemathI see the same issue using the example in the
goyacc
directory:https://github.com/golang/tools/tree/master/cmd/goyacc/testdata/expr
When adding a dummy test file:
and then running:
What did you expect to see?
The coverage pulled up in the browser.
What did you see instead?
The text was updated successfully, but these errors were encountered: