testify
testify copied to clipboard
suite: fix FailfastSuite failing when test.count > 1
FailfastSuite used a callOrder slice that gets populated by the suite methods and compared it to a string literal. When test.count is > 1 callOrder is overpopulated and does not match the expected string. Fixed this by having TearDownSuite dump the callOrder into a new slice callOrderPerRun and have tests assert each run separately.
Summary
Fixes TestFailfastSuite failing when test.count is set > 1
Changes
FailfastSuite now dumps callOrder into callOrderPerRun when TearDownSuite is called. TestFailfastSuite now compares the string literal to each entry of callOrderPerRun
Motivation
Previously running go test ./... test.count=2 resulted in failure
Related issues
Is it fixed?
$ go test ./suite -count=2
ok github.com/stretchr/testify/suite 9.404s