From bdde1628ed1d83ecff963c6bf69b117122e31791 Mon Sep 17 00:00:00 2001 From: Jean de Klerk Date: Tue, 24 Nov 2020 16:08:12 -0700 Subject: [PATCH] internal/lsp: add READMEs that describe tests, how to run tests I've recently started working on gopls. It's been a fantastic experience, but the testing strategies here have required non-trivial mental work to understand. (thanks Rebecca for all your help!) Now that I understand the testing a bit better, I wanted to codify it into a readme for the next person that comes along. I've taken a stab at that: please feel free to suggest heavy edits, it's just a best-effort attempt. Change-Id: Ib739d40ef71018521cd904844443e8c9634a10a6 Reviewed-on: https://go-review.googlesource.com/c/tools/+/273066 Reviewed-by: Rebecca Stambler Reviewed-by: Robert Findley Trust: Jean de Klerk --- gopls/doc/contributing.md | 19 +++++++++++ internal/lsp/README.md | 7 ++++ internal/lsp/tests/README.md | 66 ++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 internal/lsp/README.md create mode 100644 internal/lsp/tests/README.md diff --git a/gopls/doc/contributing.md b/gopls/doc/contributing.md index 3f40fc7372..89b42257d2 100644 --- a/gopls/doc/contributing.md +++ b/gopls/doc/contributing.md @@ -14,6 +14,25 @@ Before you begin working on an issue, please leave a comment that you are claimi Provide information to get contributors up and running here ---> +## Testing + +To run tests for just `gopls/`, run, + +``` +cd /path/to/tools/gopls +go test ./... +``` + +But, much of the gopls work involves `internal/lsp` too, so you might want to +run both: + +``` +cd /path/to/tools +cd gopls && go test ./... +cd .. +go test ./internal/lsp/... +``` + ## Debugging