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/go/packages/packagestest: support markers in go.mod files #36091
Comments
In addition, this would be helpful for refactoring internal/lsp/mod/mod_test.go to use x/tools/go/packages/packagestest. |
Change https://golang.org/cl/216838 mentions this issue: |
This change adds some basic marker support for go.mod files inside of go/expect. It requires all markers to be of the form "//@mark()", where mark can be anything. It is the same format as .go files, only difference is that it needs to have "//" since that is the only comment marker that go.mod files recognize. Updates golang/go#36091 Change-Id: Ib9e325e01020181b8cee1c1be6bb257726ce913d Reviewed-on: https://go-review.googlesource.com/c/tools/+/216838 Run-TryBot: Rohan Challa <rohan@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Change https://golang.org/cl/216839 mentions this issue: |
Change https://golang.org/cl/217541 mentions this issue: |
This change standardizes the folder structure for testdata that are used for testing the lsp. In particular, it uses the following format: - dir - primarymod - .go files - packages - go.mod (optional) - modules - repoa - mod1 - .go files - packages - go.mod (optional) As we can see, any folder inside of testdata should be of this format, where the primary test files with the markers are all located inside the primarymod folder. The modules folder is used to hold any potential dependencies that are used for testing. A consequence of this change is that we can have one directory separated by folders, where each folder is it's own module, this allows us to use internal/lsp/tests with go.mod files. Now, tests.Load() will return an array of Data objects, where each object corresponds to one of the directories structured above. Updates golang/go#36091 Change-Id: I437cc2a2a9fc1bac93779845737aa74383fbf9c3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/217541 Run-TryBot: Rohan Challa <rohan@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This change adds support for testing go.mod files within packagestest. Primarily, if there are markers in the go.mod file, this will copy the contents to a temporary file, build the modcache, then set the contents back. Updates golang/go#36091 Change-Id: Icb707906eb7fc9e4a06fe043f94f34d9223d84c9 Reviewed-on: https://go-review.googlesource.com/c/tools/+/216839 Run-TryBot: Rohan Challa <rohan@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Change https://golang.org/cl/218502 mentions this issue: |
Users of
packagestest
may want to put markers ingo.mod
files to run tests. This is particularly relevant forgopls
handlinggo.mod
files correctly./cc @ridersofrohan @ianthehat
The text was updated successfully, but these errors were encountered: