Skip to content
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

x/tools/gopls: no diagnostic for _test package which doesn't build #39578

Closed
zikaeroh opened this issue Jun 13, 2020 · 5 comments
Closed

x/tools/gopls: no diagnostic for _test package which doesn't build #39578

zikaeroh opened this issue Jun 13, 2020 · 5 comments
Labels
Milestone

Comments

@zikaeroh
Copy link
Contributor

@zikaeroh zikaeroh commented Jun 13, 2020

Please answer these questions before submitting your issue. Thanks!

What did you do?

I was working on pulling out some code into a new repo, and my code was in flux, with a new _test package and some missing types.

A repo containing the state with this bug is here: https://github.com/zikaeroh/ctxjoin-bug

What did you expect to see?

Errors reported with ctxjoin_test.go opened.

What did you see instead?

No errors, but the code definitely will not build for a multitude of reasons. I was editing and eventually after changing enough, I got no feedback.

Build info

golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@v0.0.0-20200612220849-54c614fe050c h1:dVo0gJptWG2GZtNzk9wxqZ/txRoJzjXIa7fdwZaWNLM=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
    golang.org/x/tools@v0.0.0-20200612220849-54c614fe050c h1:g6oFfz6Cmw68izP3xsdud3Oxu145IPkeFzyRg58AKHM=
    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go info

go version go1.14.4 linux/amd64

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 13, 2020

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added this to the Unreleased milestone Jun 13, 2020
@zikaeroh
Copy link
Contributor Author

@zikaeroh zikaeroh commented Jun 13, 2020

Actually, I think this seems to be an overall problem with _test packages at the moment. I wrote out "defer" in a working file, and get no diagnostics whatsoever for the syntax error, but the logs indicate that someone knows about it:

[Error - 4:28:06 PM] Request textDocument/definition failed.
  Message: no identifier found
  Code: 0 
[Error - 4:28:06 PM] Request textDocument/codeAction failed.
  Message: computing fix edits: /home/jake/zikaeroh/ctxjoin/ctxjoin_test.go:113:7: function must be invoked in defer statement (and 7 more errors)
  Code: 0 
[Error - 4:28:07 PM] Request textDocument/codeAction failed.
  Message: computing fix edits: /home/jake/zikaeroh/ctxjoin/ctxjoin_test.go:113:7: function must be invoked in defer statement (and 7 more errors)
  Code: 0 
[Error - 4:28:07 PM] Request textDocument/formatting failed.
  Message: 113:7: function must be invoked in defer statement (and 1 more errors)
  Code: 0 
[Error - 4:28:11 PM] Request textDocument/codeAction failed.
  Message: computing fix edits: /home/jake/zikaeroh/ctxjoin/ctxjoin_test.go:113:7: function must be invoked in defer statement (and 7 more errors)
  Code: 0 
[Error - 4:28:11 PM] Request textDocument/formatting failed.
  Message: 113:7: function must be invoked in defer statement (and 1 more errors)
  Code: 0 
[Info  - 4:28:40 PM] 2020/06/13 16:28:40 background imports cache refresh starting

[Info  - 4:28:40 PM] 2020/06/13 16:28:40 background refresh finished after 110.135556ms
@zikaeroh
Copy link
Contributor Author

@zikaeroh zikaeroh commented Jun 13, 2020

I bisected this to CL 236397.

@heschik

@golang golang deleted a comment Jun 14, 2020
@heschik
Copy link
Contributor

@heschik heschik commented Jun 15, 2020

Thanks, looks like our test coverage of x_tests is pretty lacking. Fix should be easy.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 15, 2020

Change https://golang.org/cl/237943 mentions this issue: internal/lsp/cache: don't skip x_tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.