generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
What do you want to see?
Hello,
we have implemented a custom struct that embeds *testing.T and adds some internal functionality, but does not change the interface.
Our custom struct looks something like this:
type Custom struct {
*testing.T
}
func (t *Custom) Errorf(format string, args ...any) {
// Some custom functionality here
t.T.Errorf(format, args...)
}
Using that custom struct with e2e-framework, however, is a bit difficult because funcs like Test in the Environment interface (see here) require a concrete *testing.T type instead of an interface.
Would it be possible to accept an interface instead, like testing.TB? Are there specific reasons why the concrete type was chosen instead of an interface? For reference, testify even has an own interface, which makes using custom wrappers like ours straightforward to use.
Thank you!
Extra Labels
No response
varnastadeus, vladimirvivien, takoverflow and ninavdl
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.