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/go/expect: TestMarker fails when run as a dependency of another module #57783

Closed
bcmills opened this issue Jan 13, 2023 · 1 comment
Closed
Assignees
Labels
FrozenDueToAge 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/go/expect

What did you expect to see?

Passing tests.

What did you see instead?

--- FAIL: TestMarker (0.00s)
    --- FAIL: TestMarker/testdata/test.go (0.00s)
        expect_test.go:57: open testdata/test.go: no such file or directory
    --- FAIL: TestMarker/testdata/go.mod (0.00s)
        expect_test.go:57: open testdata/go.mod: no such file or directory
FAIL
FAIL    golang.org/x/tools/go/expect    0.009s
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).

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label 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. Tools This label describes issues relating to any tools in the x/tools repository. and removed Tools This label describes issues relating to any tools in the x/tools repository. labels Jan 13, 2023
@gopherbot
Copy link

Change https://go.dev/cl/461942 mentions this issue: go/expect: remove testdata go.mod to go.fake.mod

@golang golang locked and limited conversation to collaborators Jan 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

3 participants