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/internal/lsp/mod: TestModfileRemainsUnchanged fails when run as a dependency of another module #57784

Closed
bcmills opened this issue Jan 13, 2023 · 1 comment
Labels
gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jan 13, 2023

What version of Go are you using (go version)?

$ go version
go version devel go1.20-245e95dfab Wed Jan 11 22:29:34 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/usr/local/google/home/bcmills/.cache/go-build"
GOENV="/usr/local/google/home/bcmills/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/tmp/tmp.uw94Sef663/.gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/tmp/tmp.uw94Sef663/.gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/google/home/bcmills/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/google/home/bcmills/sdk/gotip/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.20-245e95dfab Wed Jan 11 22:29:34 2023 +0000"
GCCGO="/usr/local/google/home/bcmills/bin/gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/tmp/tmp.uw94Sef663/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build227727649=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ go mod init example
$ go get golang.org/x/tools/go/expect@HEAD golang.org/x/tools/gopls/internal/lsp/mod@HEAD
$ go test golang.org/x/tools/gopls/internal/lsp/mod

What did you expect to see?

Passing tests.

What did you see instead?

--- FAIL: TestModfileRemainsUnchanged (0.00s)
    mod_test.go:37: stat testdata/unchanged: no such file or directory
FAIL
FAIL    golang.org/x/tools/gopls/internal/lsp/mod       0.048s
FAIL

The problem is that the testdata directory contains a go.mod file, which causes it not to be included in the golang.org/x/tools module containing the actual test (see #27852).

@bcmills bcmills changed the title affected/package: x/tools/gopls/internal/lsp/mod: TestModfileRemainsUnchanged fails when run as a dependency of another module Jan 13, 2023
@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 Jan 13, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jan 13, 2023
@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. labels Jan 13, 2023
@dle8 dle8 modified the milestones: Unreleased, gopls/later Jan 19, 2023
@gopherbot
Copy link

Change https://go.dev/cl/518976 mentions this issue: gopls/internal/lsp/mod: remove TestModfileRemainsUnchanged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants