-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Labels
area/gitGit related issues and pull requestsGit related issues and pull requestsarea/testingTesting related issues and pull requestsTesting related issues and pull requests
Description
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:
func TestMain(m *testing.M) {
// execute test against unmanaged transport
code := m.Run()
if code != 0 {
os.Exit(code)
}
managed.InitManagedTransport(logr.Discard())
// execute test against managed transport
code = m.Run()
os.Exit(code)
}
func TestManaged_something(t *testing.T) {
if !managed.Enabled() {
t.Skip()
}
// Managed only tests...
}
func TestUnmanaged_something(t *testing.T) {
if managed.Enabled() {
t.Skip()
}
// Unmanaged only tests...
}
func TestBoth_something(t *testing.T) {
// Test supported for both managed and unmanaged...
}
Metadata
Metadata
Assignees
Labels
area/gitGit related issues and pull requestsGit related issues and pull requestsarea/testingTesting related issues and pull requestsTesting related issues and pull requests
Type
Projects
Status
Done