]> Cypherpunks repositories - gostls13.git/commit
all: use ^TestName$ regular pattern for invoking a single test
authorDmitri Shuralyov <dmitshur@golang.org>
Sun, 3 Sep 2023 18:23:02 +0000 (14:23 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 5 Sep 2023 23:35:29 +0000 (23:35 +0000)
commit0dfb22ed70749a2cd6d95ec6eee63bb213a940d4
treeba421b5cae00d9541f48ab2710a76e7fd722adda
parentcffdfe8d2cabbe874bceaeed1eba92cc567be6db
all: use ^TestName$ regular pattern for invoking a single test

Use ^ and $ in the -run flag regular expression value when the intention
is to invoke a single named test. This removes the reliance on there not
being another similarly named test to achieve the intended result.

In particular, package syscall has tests named TestUnshareMountNameSpace
and TestUnshareMountNameSpaceChroot that both trigger themselves setting
GO_WANT_HELPER_PROCESS=1 to run alternate code in a helper process. As a
consequence of overlap in their test names, the former was inadvertently
triggering one too many helpers.

Spotted while reviewing CL 525196. Apply the same change in other places
to make it easier for code readers to see that said tests aren't running
extraneous tests. The unlikely cases of -run=TestSomething intentionally
being used to run all tests that have the TestSomething substring in the
name can be better written as -run=^.*TestSomething.*$ or with a comment
so it is clear it wasn't an oversight.

Change-Id: Iba208aba3998acdbf8c6708e5d23ab88938bfc1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/524948
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
31 files changed:
src/cmd/cgo/internal/test/issue18146.go
src/cmd/compile/internal/test/ssa_test.go
src/cmd/go/alldocs.go
src/cmd/go/internal/help/help.go
src/cmd/go/internal/lockedfile/lockedfile_test.go
src/cmd/go/main.go
src/flag/flag_test.go
src/internal/cpu/cpu_test.go
src/internal/godebug/godebug_test.go
src/internal/platform/supported.go
src/internal/syscall/windows/exec_windows_test.go
src/math/big/calibrate_test.go
src/net/http/cgi/integration_test.go
src/net/http/fs_test.go
src/net/http/httptest/server.go
src/net/http/serve_test.go
src/os/os_test.go
src/os/os_windows_test.go
src/os/pipe_test.go
src/os/removeall_test.go
src/os/signal/signal_cgo_test.go
src/os/signal/signal_test.go
src/runtime/abi_test.go
src/runtime/crash_test.go
src/runtime/malloc_test.go
src/runtime/vdso_test.go
src/syscall/exec_linux_test.go
src/syscall/exec_unix_test.go
src/syscall/exec_windows_test.go
src/testing/flag_test.go
src/testing/panic_test.go