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

cmd/dist: No way to run verbose / for tests #39714

Closed
stevenh opened this issue Jun 19, 2020 · 6 comments
Closed

cmd/dist: No way to run verbose / for tests #39714

stevenh opened this issue Jun 19, 2020 · 6 comments

Comments

@stevenh
Copy link
Contributor

@stevenh stevenh commented Jun 19, 2020

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

go version go1.14.4 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="/data/go/bin"
GOCACHE="/home/steveh/.cache/go-build"
GOENV="/home/steveh/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/data/go:/home/steveh/code"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/steveh/code/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build968762670=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Tried to run tests pkg with verbose and force e.g.
./run.bash -run=net/http -v -count=1

What did you expect to see?

The net/http always run with verbose enabled.

What did you see instead?

The following error when run with -count=1
flag provided but not defined: -count
No verbose details from the tests from -v

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 19, 2020

Change https://golang.org/cl/239077 mentions this issue: cmd/dist: Support verbose and count test flags

@bcmills
Copy link
Member

@bcmills bcmills commented Jun 19, 2020

Um... Why use run.bash in that case instead of go test directly?

@stevenh
Copy link
Contributor Author

@stevenh stevenh commented Jun 19, 2020

Because they fail due to the use of an internal package:

net/http> go test
transfer.go:15:2: use of internal package net/http/internal not allowed

I would much prefer to be able to use go test directly, so if I've missed something and its possible, I would love to know.

@bcmills
Copy link
Member

@bcmills bcmills commented Jun 19, 2020

Are you using a go binary built from a different GOROOT? (What does go list . report for the package path?)

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 19, 2020

@stevenh That shouldn't happen. Check that the go tool that is on your PATH has a GOROOT that matches the directory that you are testing.

For me:

> cd `go env GOROOT`/src/net/http
> go test -test.short
PASS
ok  	net/http	4.098s
@stevenh
Copy link
Contributor Author

@stevenh stevenh commented Jun 19, 2020

Yes of course, totally obvious now you mentioned it, clearly hadn't had enough coffee today.

Either resetting GOROOT or just relative pathing to it to run the correct go fixes the issue.

@stevenh stevenh closed this Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.