-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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/go/internal/test: compile error for go test
on package with no test files does not output package-level "FAIL" error
#64286
Comments
This problem does not seem to occur in the latest development version of Go. go 1.20 > go version
go version go1.20.1 windows/amd64
> go test ./pkg ./pkg2
# foo/pkg2
pkg2\main.go:7:2: undefined: foo
note: module requires Go 1.22
? foo/pkg [no test files]
FAIL go 1.22 dev > ../bin/go version
go version devel go1.22-5f7a408563 Wed Nov 22 02:20:04 2023 +0000 windows/amd64
> ../bin/go test ./pkg ./pkg2
# foo/pkg2
pkg2\main.go:7:2: undefined: foo
? foo/pkg [no test files]
FAIL foo/pkg2 [build failed]
FAIL I thought that the older version printed the go/src/cmd/go/internal/test/test.go Lines 1236 to 1246 in 789b3f8
go/src/cmd/go/internal/test/test.go Lines 1262 to 1265 in 789b3f8
However, the new version prints the go/src/cmd/go/internal/test/test.go Lines 1250 to 1258 in 5b123ae
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run
go test ./pkg ./pkg2
on the following directory:go.mod:
pkg/main.go:
package pkg2/main.go (does not compile)
What did you expect to see?
The above is the output that shows up if I add a
pkg2/main_test.go
file with a line `package pkg2 line in the file.What did you see instead?
The
FAIL foo/pkg2 [build failed]
line is missing. This is true in both regular and-json
output formats, which makes it harder to parse the results of CI runs on many packages to see which packages resulted in failures.The text was updated successfully, but these errors were encountered: