]> Cypherpunks repositories - gostls13.git/commit
testing: use subprocesses in TestTBHelper and TestTBHelperParallel
authorBryan C. Mills <bcmills@google.com>
Wed, 28 Jun 2023 19:04:24 +0000 (15:04 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 21 Nov 2023 17:24:47 +0000 (17:24 +0000)
commit0cb45bac014715433c0110675cc4e32d871a5ff0
tree62b7b44a9c08df2e9e415054cbe8f20d342f3f5b
parentbbcd85528cbad2dca72378181cb230e59a43ef80
testing: use subprocesses in TestTBHelper and TestTBHelperParallel

These tests are checking the output of test functions that call the
Helper methods. However, they were reaching into package internals
instead of running those test functions as actual tests.

That not only produced significant differences in formatting (such as
indentation for subtests), but also caused test flags such as
"-failfast" passed for the overall test run to interfere with the
output formatting.

Now, we run the test functions as real tests in a subprocess,
so that we get the real output and formatting of those tests.
This makes the tests not only more realistic, but also less
sensitive to otherwise-irrelevant implementation details
(such as the names and signatures of unexported types and
functions in the testing package).

Fixes #61016.

Change-Id: I646fbbd7cfeb00382054677f726c05fc9d35d0dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/506955
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/testing/helper_test.go
src/testing/helperfuncs_test.go