Hi,
I’m trying to use gobco to measure branch coverage for Kubernetes integration tests, specifically under:
kubernetes repo
Path: test/integration/apimachinery
Issue
When running gobco on these integration tests, I encounter the following panic:
panic: can only handle TestMain with explicit call to os.Exit
Context
Kubernetes integration tests frequently define a custom TestMain(m *testing.M) for environment setup/teardown (e.g., API server initialization), and not all of them explicitly call os.Exit(m.Run()).
It appears that gobco expects TestMain to strictly follow this pattern:
func TestMain(m *testing.M) {
os.Exit(m.Run())
}
However, many real-world integration tests (including Kubernetes) use more complex logic, such as:
func TestMain(m *testing.M) {
framework.EtcdMain(m.Run)
}
or in some cases, omit the explicit os.Exit call entirely.
Question:
Does gobco currently only support unit tests or simple TestMain patterns?
Hi,
I’m trying to use gobco to measure branch coverage for Kubernetes integration tests, specifically under:
kubernetes repo
Path: test/integration/apimachinery
Issue
When running gobco on these integration tests, I encounter the following panic:
Context
Kubernetes integration tests frequently define a custom TestMain(m *testing.M) for environment setup/teardown (e.g., API server initialization), and not all of them explicitly call os.Exit(m.Run()).
It appears that gobco expects TestMain to strictly follow this pattern:
However, many real-world integration tests (including Kubernetes) use more complex logic, such as:
or in some cases, omit the explicit os.Exit call entirely.
Question:
Does gobco currently only support unit tests or simple TestMain patterns?