From 09660450394657510880197974d5ccfabd7bef8b Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 4 Nov 2017 12:35:23 +1100 Subject: [PATCH] internal/testenv: mark SkipFlaky and SkipFlakyNet as helpers 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/internal/testenv/testenv.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go index 83f0e8347a..b3c16a8e87 100644 --- a/src/internal/testenv/testenv.go +++ b/src/internal/testenv/testenv.go @@ -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") } -- 2.48.1