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
jadekler opened this issue Sep 9, 2020 · 5 comments
Closed

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

jadekler opened this issue Sep 9, 2020 · 5 comments

Comments

@jadekler
Copy link
Contributor

@jadekler jadekler 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 this to the Unreleased milestone Sep 9, 2020
@stamblerre
Copy link
Contributor

@stamblerre 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 removed this from the Unreleased milestone Sep 11, 2020
@jadekler
Copy link
Contributor Author

@jadekler jadekler 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". 🤔

@jadekler
Copy link
Contributor Author

@jadekler jadekler commented Sep 11, 2020

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

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 14, 2020

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.

@jadekler
Copy link
Contributor Author

@jadekler jadekler commented Sep 14, 2020

Ahhh! Thank you!

@jadekler jadekler closed this Sep 14, 2020
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.