gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
1.99k stars 118 forks source link

Update gotestsum retries to properly filter out parents when there is a a missing gap in the parent tree #377

Closed ddworken closed 9 months ago

ddworken commented 9 months ago

If someone creates a test name with / in the name, then it is possible to end up with a hierarchy with a gap. For example, if someone creates a subtest of TestParent with the name child/grandchild and it fails, then the two failing tests will be TestParent and TestParent/child/grandchild. This breaks FilterFailedUnique and will cause it not to filter out TestParent which means that all child tests will get rerun. This PR fixes this by updating the parents to include all the parents of the given test case.

If you're curious for why someone would be doing this, I don't think there is any strong requirement for people to do this, but personally I do it in hishtory and I suspect I'm not the only person doing this. So it seems like a useful change. WDYT?