The f1. T type is almost compatible with the testing.TB interface which exposes the common methods of testing.T, testing.B and testing.F.
Making f1.T completely compatible with testing.TB or exposing a similar interface with a subset of the testing.TB methods (and amending ScenarioFn to use this interface) would facilitate reusing the same test implementation as standard tests or f1 load tests as well as being a generally good practice.
The changes necessary to f1.T to achieve compatibility with testing.TB would be as follows:
| testing.TB method |
f1.T method |
Changes Required |
| Error(args ...any) |
func (t *T) Error(err error) |
backward compatible signature change |
| Fatal(args ...any) |
func (t *T) Fatal(err error) |
backward compatible signature change |
| Helper() |
(not implemented) |
stub implementation |
| Setenv(key, value string) |
(not implemented) |
stub implementation |
| Skip(args ...any) |
(not implemented) |
stub implementation |
| SkipNow() |
(not implemented) |
stub implementation |
| Skipf(format string, args ...any) |
(not implemented) |
stub implementation |
| Skipped() bool |
(not implemented) |
stub implementation |
| TempDir() string |
(not implemented) |
stub implementation |
The
f1. Ttype is almost compatible with thetesting.TBinterface which exposes the common methods oftesting.T,testing.Bandtesting.F.Making
f1.Tcompletely compatible withtesting.TBor exposing a similar interface with a subset of the testing.TB methods (and amendingScenarioFnto use this interface) would facilitate reusing the same test implementation as standard tests or f1 load tests as well as being a generally good practice.The changes necessary to
f1.Tto achieve compatibility withtesting.TBwould be as follows: