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/go: tests are skipped when GOOS/GOARCH do not match the installed toolchain #53936

Closed
bcmills opened this issue Jul 18, 2022 · 1 comment
Closed
Assignees
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Member

bcmills commented Jul 18, 2022

The test binary for cmd/go currently skips itself completely when its GOOS or GOARCH doesn't match the GOOS or GOARCH of the installed toolchain:
https://cs.opensource.google/go/go/+/master:src/cmd/go/go_test.go;l=196-214;drc=c2edb2c841149f2e56963071065d52247e24092a

Unfortunately, that makes it much more difficult than necessary to diagnose test failures that are specific to a GOOS or GOARCH, especially when those tests can be run natively (such as for 386 on an amd64 host) or under emulation (such as for tests that happen to mostly-work under QEMU).

The problem is especially acute now that we have fuzzing: 386 builds lack fuzzer instrumentation (so tests on that architecture behave substantially differently than on amd64), and many tests of the fuzzer are implemented as cmd/go script tests so that they can check the behavior of go test -fuzz=. end-to-end.

I have a pending fix for this in CL 356611.

@bcmills bcmills self-assigned this Jul 18, 2022
@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. labels Jul 18, 2022
@bcmills bcmills added this to the Go1.20 milestone Jul 18, 2022
@gopherbot
Copy link

Change https://go.dev/cl/356611 mentions this issue: cmd/go: run tests when cmd/go is cross-compiled

@bcmills bcmills removed the Testing An issue that has been verified to require only test changes, not just a test failure. label Jul 18, 2022
@golang golang locked and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants