-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Description
Problem
After using go test -failfast to find the first failing test, then fixing the failure, there is no straightforward way to resume the tests from the point of failure. I have to either run all the earlier tests again, or enumerate the list of tests that come after the failing test.
Goal
Reduce the total time to resolve multiple bugs that each affect one or more tests but not most or all tests. Reduce the number of times each test is run.
Proposal
Add a flag such that -run TestFoo will not only run all tests matching TestFoo but all tests after the first such match.
Example
$ go test -failfast
--- PASS: TestA
--- PASS: TestB
--- FAIL: TestC
$ patch -i fix_test_c.patch
$ go test -run TestC
--- PASS: TestC
$ go test -failfast
--- PASS: TestA
--- PASS: TestB
--- PASS: TestC
--- PASS: TestD
--- FAIL: TestE
I didn't want to run TestA or TestB again here, or TestC an extra time. I would rather have done something like
go test -run TestC -andlatertests -failfast
(I acknowledge that's not a good name for the flag)
seankhliao, bitfield, anton2920, earthboundkid and arp242
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Incoming