From 5d18337f72d17f97ee237b06876d55d5620e48de Mon Sep 17 00:00:00 2001 From: PierrunoYT Date: Tue, 14 Jul 2026 22:51:37 +0200 Subject: [PATCH 1/2] fix(lsp): make real-gopls integration test opt-in via env var TestManagerCheckRealGopls ran whenever a gopls binary was on PATH, so an installed but unusable gopls (e.g. a broken persistent-index cache) failed the default go test ./... suite with 'lsp error -1: EOF'. Gate the test behind ZERO_LSP_REAL_GOPLS_TEST=1, following the existing opt-in convention for smoke tests, so the default hermetic suite never depends on the health of a developer's global language server. Default coverage continues to use the fake LSP server. Fixes #684 Co-Authored-By: Claude Fable 5 --- internal/lsp/real_gopls_manual_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/lsp/real_gopls_manual_test.go b/internal/lsp/real_gopls_manual_test.go index 79944b4fe..57373516c 100644 --- a/internal/lsp/real_gopls_manual_test.go +++ b/internal/lsp/real_gopls_manual_test.go @@ -11,9 +11,13 @@ import ( // TestManagerCheckRealGopls drives the exact path the self-correct LSP wiring // uses (NewManager -> Check) against a REAL gopls and asserts a real diagnostic -// comes back. Skips when gopls is not installed. Temporary manual-verification -// test (the rest of the suite uses a fake server). +// comes back. Opt-in manual-verification test (the rest of the suite uses a +// fake server): the health, version, or cache state of a developer's globally +// installed gopls must not fail the default hermetic suite. func TestManagerCheckRealGopls(t *testing.T) { + if os.Getenv("ZERO_LSP_REAL_GOPLS_TEST") == "" { + t.Skip("set ZERO_LSP_REAL_GOPLS_TEST=1 to run the real gopls integration test") + } if _, err := exec.LookPath("gopls"); err != nil { t.Skip("gopls not on PATH; skipping real-server check") } From 23390b05e03ee6004a07eca284f975a56fdc99fe Mon Sep 17 00:00:00 2001 From: PierrunoYT Date: Tue, 14 Jul 2026 23:19:34 +0200 Subject: [PATCH 2/2] fix(lsp): require ZERO_LSP_REAL_GOPLS_TEST=1 exactly for opt-in Any non-empty value (including 0 or false) enabled the real gopls test, contradicting the documented =1 contract in the skip message. Compare against "1" exactly, per PR review. Co-Authored-By: Claude Fable 5 --- internal/lsp/real_gopls_manual_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/lsp/real_gopls_manual_test.go b/internal/lsp/real_gopls_manual_test.go index 57373516c..17ee97912 100644 --- a/internal/lsp/real_gopls_manual_test.go +++ b/internal/lsp/real_gopls_manual_test.go @@ -15,7 +15,7 @@ import ( // fake server): the health, version, or cache state of a developer's globally // installed gopls must not fail the default hermetic suite. func TestManagerCheckRealGopls(t *testing.T) { - if os.Getenv("ZERO_LSP_REAL_GOPLS_TEST") == "" { + if os.Getenv("ZERO_LSP_REAL_GOPLS_TEST") != "1" { t.Skip("set ZERO_LSP_REAL_GOPLS_TEST=1 to run the real gopls integration test") } if _, err := exec.LookPath("gopls"); err != nil {