]> Cypherpunks repositories - gostls13.git/commitdiff
internal/testenv: mark SkipFlaky and SkipFlakyNet as helpers
authorAlex Brainman <alex.brainman@gmail.com>
Sat, 4 Nov 2017 01:35:23 +0000 (12:35 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 4 Nov 2017 05:36:49 +0000 (05:36 +0000)
This makes the output they print refer to the code that called them.

For example, instead of

=== RUN   TestWindowsStackMemoryCgo
--- SKIP: TestWindowsStackMemoryCgo (0.00s)
        testenv.go:213: skipping known flaky test ...
PASS

we see

=== RUN   TestWindowsStackMemoryCgo
--- SKIP: TestWindowsStackMemoryCgo (0.00s)
        crash_cgo_test.go:471: skipping known flaky test ...
PASS

Change-Id: I5f4c77c3aeab5c0e43c6dde2f15db70a6df24603
Reviewed-on: https://go-review.googlesource.com/76031
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/internal/testenv/testenv.go

index 83f0e8347a1ce907074518c28ed3b2bbe97a6260..b3c16a8e8727d991b7db61df6b0382cd964bc337 100644 (file)
@@ -209,12 +209,14 @@ func MustHaveLink(t testing.TB) {
 var flaky = flag.Bool("flaky", false, "run known-flaky tests too")
 
 func SkipFlaky(t testing.TB, issue int) {
+       t.Helper()
        if !*flaky {
                t.Skipf("skipping known flaky test without the -flaky flag; see golang.org/issue/%d", issue)
        }
 }
 
 func SkipFlakyNet(t testing.TB) {
+       t.Helper()
        if v, _ := strconv.ParseBool(os.Getenv("GO_BUILDER_FLAKY_NET")); v {
                t.Skip("skipping test on builder known to have frequent network failures")
        }