mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-23 22:11:13 +01:00
Implement a few additional methods on retryingTester so it works with testify
This commit is contained in:
parent
0ee8c1c796
commit
c690688834
@ -201,11 +201,42 @@ func (t *retryingTester) Fatalf(format string, args ...any) {
|
||||
if t.isFinalRun {
|
||||
t.T.Fatalf(format, args...)
|
||||
} else {
|
||||
testutils.TestLog(t.T, fmt.Sprintf("retryingTester: Ignoring failure for non-final run: %#v", fmt.Sprintf(format, args...)))
|
||||
testutils.TestLog(t.T, fmt.Sprintf("retryingTester: Ignoring fatalf for non-final run: %#v", fmt.Sprintf(format, args...)))
|
||||
}
|
||||
t.SkipNow()
|
||||
}
|
||||
|
||||
func (t *retryingTester) Errorf(format string, args ...any) {
|
||||
t.T.Helper()
|
||||
t.succeeded = false
|
||||
if t.isFinalRun {
|
||||
t.T.Errorf(format, args...)
|
||||
} else {
|
||||
testutils.TestLog(t.T, fmt.Sprintf("retryingTester: Ignoring errorf for non-final run: %#v", fmt.Sprintf(format, args...)))
|
||||
}
|
||||
t.SkipNow()
|
||||
}
|
||||
|
||||
func (t *retryingTester) FailNow() {
|
||||
t.succeeded = false
|
||||
if t.isFinalRun {
|
||||
t.T.FailNow()
|
||||
} else {
|
||||
testutils.TestLog(t.T, "retryingTester: Ignoring FailNow for non-final run")
|
||||
// Still terminate execution via SkipNow() since FailNow() means we should stop the current test
|
||||
t.T.SkipNow()
|
||||
}
|
||||
}
|
||||
|
||||
func (t *retryingTester) Fail() {
|
||||
t.succeeded = false
|
||||
if t.isFinalRun {
|
||||
t.T.Fail()
|
||||
} else {
|
||||
testutils.TestLog(t.T, "retryingTester: Ignoring Fail for non-final run")
|
||||
}
|
||||
}
|
||||
|
||||
func testIntegration(t *testing.T, tester shellTester, onlineStatus OnlineStatus) {
|
||||
// Set up
|
||||
defer testutils.BackupAndRestore(t)()
|
||||
|
Loading…
Reference in New Issue
Block a user