It started to fail consistently since CL 603476 (on the main repo). E.g. https://ci.chromium.org/ui/p/golang/builders/ci/x_playground-gotip-linux-amd64/b8738967458806380001/overview https://logs.chromium.org/logs/golang/buildbucket/cr-buildbucket/8738967458806380001/+/u/step/18/log/2
Apparently some tests need fix to make the new vet happy.
cc @adonovan @toothrot
Comment From: gabyhelp
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: ianlancetaylor
These invalid names are intentionally chosen. Not sure what we should do here.
// TestisNotATest is not a test function, despite appearances.
//
// Please ignore any lint or vet warnings for this function.
func TestisNotATest(t *testing.T) {
panic("This is not a valid test function.")
}
Comment From: cherrymui
Interesting. Maybe we can set the x/playground repo to run with GOFLAGS=-vet=off
(or some flag to just disable the -tests check, if possible)? Or move those not-a-test functions to testdata?
Comment From: adonovan
For the tests of ill-formed Test functions in GOROOT, I added -vet=off to the go test commands as needed. Unfortunately in this case the design of the test mixes the (sound) test harness and the (invalid) code under test in the same source file. Really the latter code should be split into a separate file beneath testdata (as @cherrymui said). Unfortunately that's not a quick fix.
Comment From: gopherbot
Change https://go.dev/cl/607835 mentions this issue: TestIsTest: move ill-formed tests into a testdata subpackage