Skip to content

Real gopls manual test can fail the default suite on an unusable installation #684

Description

@PierrunoYT

Summary

TestManagerCheckRealGopls is described as a temporary manual-verification test, but it runs as part of the default go test ./... suite whenever a gopls executable exists. An installed but unusable gopls causes the entire suite to fail instead of skipping or remaining opt-in.

Reproduction

go test ./internal/lsp -run '^TestManagerCheckRealGopls$' -count=1 -v

Observed:

Manager.Check returned error: lsp error -1: EOF

On this host, gopls version also reports that it cannot create its persistent-index cache because a cache path component already exists in an incompatible form. The binary is present on PATH, so the test does not skip, but the server exits during initialization and Zero observes EOF.

Environment: Go 1.26.5, Windows amd64. Observed at upstream commit 6fc1220.

Relevant code

internal/lsp/real_gopls_manual_test.go skips only when exec.LookPath("gopls") reports that the binary is absent. Its comment calls it a temporary manual-verification test, yet it has no build tag or explicit opt-in.

Expected behavior

The default hermetic test suite should not fail based on the health, version, or local cache state of a developer's globally installed language server.

Actual behavior

Any executable named gopls enables the integration test; initialization failures such as EOF fail go test ./....

Suggested fix

Move the real-server test behind an integration build tag or explicit environment-variable opt-in. Keep default coverage on the existing fake LSP server. If the real-server test remains automatic, probe gopls health/version and skip with a clear reason when initialization is unavailable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions