chore: support configurable Go module proxy

This commit is contained in:
2026-09-23 00:47:19 +08:00
parent 15825f0ab8
commit 2b93545507
3 changed files with 19 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ import sys
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--image", default="golang:1.25")
parser.add_argument("--goproxy", default="", help="optional Go module proxy passed to the container")
parser.add_argument("--duration", default="30m")
parser.add_argument("--timeout", default="35m", help="go test timeout (default: 35m)")
parser.add_argument("--gomaxprocs", type=int, default=2)
@@ -27,6 +28,10 @@ def main() -> None:
"-v", f"{root}:/workspace", "-w", "/workspace",
"-e", "GOWORK=off", "-e", f"GOMAXPROCS={args.gomaxprocs}",
"-e", f"GO_OMNI_HTTP2_SOAK_DURATION={args.duration}",
]
if args.goproxy:
command += ["-e", f"GOPROXY={args.goproxy}"]
command += [
args.image, "go", "test", "-race", "-timeout", args.timeout, "./transport/http2",
"-run", "^TestTLSSoak$", "-count=1",
]