You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that managed.InitManagedTransport is an unreversible operation, and that we want to support both unmanaged and managed transport for at least a minor release, we might want to run tests against both when that makes sense, and skip when a specific test is transport sensitive.
Something around the lines of:
funcTestMain(m*testing.M) {
// execute test against unmanaged transportcode:=m.Run()
ifcode!=0 {
os.Exit(code)
}
managed.InitManagedTransport(logr.Discard())
// execute test against managed transportcode=m.Run()
os.Exit(code)
}
funcTestManaged_something(t*testing.T) {
if!managed.Enabled() {
t.Skip()
}
// Managed only tests...
}
funcTestUnmanaged_something(t*testing.T) {
ifmanaged.Enabled() {
t.Skip()
}
// Unmanaged only tests...
}
funcTestBoth_something(t*testing.T) {
// Test supported for both managed and unmanaged...
}
#746 addresses the same issue in a different way. Instead of using a TestMain and skipping tests, when required it places all the tests in different files strategically, leveraging the fact that golang runs tests in a package based on an alphabetical order of the file names in the package. This lets us run all the tests using unmanaged transports prior to any other tests, letting us test both managed and unmanaged transports.
Given that
managed.InitManagedTransport
is an unreversible operation, and that we want to support both unmanaged and managed transport for at least a minor release, we might want to run tests against both when that makes sense, and skip when a specific test is transport sensitive.Something around the lines of:
Potential follow-up of #744, #727 and #718.
The text was updated successfully, but these errors were encountered: