net/http: move TestOmitHTTP2 to cmd/dist

This will ensure that test IDs that are generated are unique on
builders.

Change-Id: I4762f072c7082dd812a1d7cb3ed1968c6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/777480
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Nicholas Husin <husin@google.com>
This commit is contained in:
Nicholas S. Husin 2026-05-12 18:45:13 -04:00 committed by Gopher Robot
parent 42bdffec2d
commit aa3c8ed492
2 changed files with 8 additions and 26 deletions

View file

@ -703,6 +703,14 @@ func (t *tester) registerTests() {
})
}
// Tests that the nethttpomithttp2 build tag doesn't rot too much,
// even if there's not a regular builder on it.
t.registerTest("net/http with tag nethttpomithttp2", &goTest{
variant: "nethttpomithttp2",
tags: []string{"nethttpomithttp2"},
pkg: "net/http",
})
// Check that all crypto packages compile with the purego build tag.
t.registerTest("crypto with tag purego (build and vet only)", &goTest{
variant: "purego",

View file

@ -80,32 +80,6 @@ func TestCmdGoNoHTTPServer(t *testing.T) {
}
}
// Tests that the nethttpomithttp2 build tag doesn't rot too much,
// even if there's not a regular builder on it.
func TestOmitHTTP2(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
t.Parallel()
goTool := testenv.GoToolPath(t)
out, err := testenv.Command(t, goTool, "test", "-short", "-tags=nethttpomithttp2", "net/http").CombinedOutput()
if err != nil {
t.Fatalf("go test -short failed: %v, %s", err, out)
}
}
// Tests that the nethttpomithttp2 build tag at least type checks
// in short mode.
// The TestOmitHTTP2 test above actually runs tests (in long mode).
func TestOmitHTTP2Vet(t *testing.T) {
t.Parallel()
goTool := testenv.GoToolPath(t)
out, err := testenv.Command(t, goTool, "vet", "-tags=nethttpomithttp2", "net/http").CombinedOutput()
if err != nil {
t.Fatalf("go vet failed: %v, %s", err, out)
}
}
var valuesCount int
func BenchmarkCopyValues(b *testing.B) {