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: how do you use -skip-cleanup? #41306

Closed
jeanbza opened this issue Sep 9, 2020 · 5 comments
Closed

x/tools/gopls: how do you use -skip-cleanup? #41306

jeanbza opened this issue Sep 9, 2020 · 5 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@jeanbza
Copy link
Member

jeanbza commented Sep 9, 2020

How does one use the -skip-cleanup flag?

When I do, go test -v ./... -run Foo/bar -skip-cleanup, I confusingly get a usage warning but the test also runs (apparently without the flag, because the temp dir is not deleted).

Am I using it incorrectly?

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Sep 9, 2020
@gopherbot gopherbot added this to the Unreleased milestone Sep 9, 2020
@stamblerre
Copy link
Contributor

stamblerre commented Sep 10, 2020

I was able to use it in the following way (as an example):

go test ./internal/lsp/ -run=TestLSP/Modules/testdata/upgradedep/Link/go.mod -skip-cleanup -v

Does that work for you?

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 11, 2020
@stamblerre stamblerre removed this from the Unreleased milestone Sep 11, 2020
@jeanbza
Copy link
Member Author

jeanbza commented Sep 11, 2020

I'm running gopls/ tests - maybe that makes a difference?

I tried,

$ cd gopls
$ go test ./internal/regtest -run=TestDeklerkRename/singleton -skip-cleanup -v
[...]
$ ls /var/folders/n3/n33wx2bs307ck7t4qpwb6csw00h16k/T/gopls-regtest-896525474/TestDeklerkRename/singleton/gopls-sandbox-605086105
ls: /var/folders/n3/n33wx2bs307ck7t4qpwb6csw00h16k/T/gopls-regtest-896525474/TestDeklerkRename/singleton/gopls-sandbox-605086105: No such file or directory

No flag error this time - which is great! - but still getting "directory not found". 🤔

@jeanbza
Copy link
Member Author

jeanbza commented Sep 11, 2020

FWIW I'm able to modify gopls/internal/regtest/runner.go:408 to force skip cleanup!

@stamblerre
Copy link
Contributor

Ah, the skip cleanup flag name for the regression tests is slightly different: https://github.com/golang/tools/blob/17fc728d0d1efaff9bd884307e377e5b1469e08b/gopls/internal/regtest/reg_test.go#L25.

@jeanbza
Copy link
Member Author

jeanbza commented Sep 14, 2020

Ahhh! Thank you!

@jeanbza jeanbza closed this as completed Sep 14, 2020
@golang golang locked and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants