Skip to content

go/test: go test -v flag does not print name of all test cases #74573

Closed as not planned
@aldlfkahs

Description

@aldlfkahs

Go version

go version go1.24.2 windows/amd64

Output of go env in your module/workspace:

set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=1
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\aldlfkahs\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\aldlfkahs\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\ALDLFK~1\AppData\Local\Temp\go-build2201675942=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=D:\Git\gateway\go.mod
set GOMODCACHE=C:\Users\aldlfkahs\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\aldlfkahs\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\aldlfkahs\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.24.2
set GOWORK=
set PKG_CONFIG=pkg-config

What did you do?

I run go test -v ./... to get test results in detail.

What did you see happen?

Not all test cases are printed in details.

D:\Git\gateway>go test ./... -v
PASS
ok      gateway/internal/api/cluster 0.164s
PASS
ok      gateway/internal/api/condition       0.168s
=== RUN   TestXmlBodyConvert
--- PASS: TestXmlBodyConvert (0.00s)
=== RUN   TestXmlEmptyBodyConvert
--- PASS: TestXmlEmptyBodyConvert (0.00s)
=== RUN   TestXmlErrorConvert
--- PASS: TestXmlErrorConvert (0.00s)
=== RUN   TestXmlConvertMustahce
--- PASS: TestXmlConvertMustahce (0.00s)
PASS
ok      gateway/internal/api/converter       0.108s

You can see that cluster and condition package test code passed, but no test cases are printed.
However, converter test code prints all test cases properly.
I already tried cleaning cache and -count=1 option.

Package name of each test code has same pattern; xxx_test.
The test function name conventions were also followed correctly.

I'm sorry that I can't give the code because it's the confidential for my company.
I tried to reproduce the issue by sample project, but I couldn't reproduce through small project.

What did you expect to see?

D:\Git\gateway>go test ./... -v
=== RUN   TestCluster
--- PASS: TestCluster (0.00s)
PASS
ok      gateway/internal/api/cluster 0.164s
=== RUN   TestCondition
--- PASS: TestCondition (0.00s)
PASS
ok      gateway/internal/api/condition       0.168s
=== RUN   TestXmlBodyConvert
--- PASS: TestXmlBodyConvert (0.00s)
=== RUN   TestXmlEmptyBodyConvert
--- PASS: TestXmlEmptyBodyConvert (0.00s)
=== RUN   TestXmlErrorConvert
--- PASS: TestXmlErrorConvert (0.00s)
=== RUN   TestXmlConvertMustahce
--- PASS: TestXmlConvertMustahce (0.00s)
PASS
ok      gateway/internal/api/converter       0.108s

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions