Skip to content

fix: count failed parent nodes with passing leaves in test stats#34

Merged
jeffatgametime merged 1 commit into
masterfrom
count-failed-parent-nodes
Jul 8, 2026
Merged

fix: count failed parent nodes with passing leaves in test stats#34
jeffatgametime merged 1 commit into
masterfrom
count-failed-parent-nodes

Conversation

@jeffatgametime

Copy link
Copy Markdown
Contributor

Feature/bug description:

Found via api-tests staging run staging/8216516902_109_51_51_0_0_0: the results UI (and Slack summary) reported 51/51, 100% passed while the suite Result was failed. The musicmary package's parent test node failed in cleanup (inventory listing-delete timeout) after both its subtests passed — and SumTestStats only counts leaves, so a failed parent with passing children contributes nothing to failed. FindFailingTests has the same recursion shape, so the failure was also unattributable in summaries (empty failure list on a failed run).

This is how I decided to implement/fix it:

  • SumTestStats: after summing children, a node that is failed while its leaves contributed zero failures counts itself as one failing test — totals can no longer say 100% for a failed tree.
  • FindFailingTests: when recursion over a failed node's subtests yields nothing, return the node itself so the failure is attributable to the parent (body-after-subtests or cleanup).
  • Table tests for both shapes; existing fixture trees unaffected (purely additive for this shape).

What can this break:

Consumers see total grow by one for this shape (the failed parent), which is the point — counts become consistent with Result. api-tests will pick this up via a version bump (v0.3.2) after merge; its Slack failure list then names the parent test instead of rendering an empty list.

How has this been tested:

go test ./... and golangci-lint run green; new cases cover both functions.

🤖 Generated with Claude Code

A test node that fails after all its subtests passed (an error in the
parent body or its cleanup) was invisible in SumTestStats - counts only
walked leaves - so a failed suite could report 100% passed. Count the
failed parent as one failing test, and return it from FindFailingTests
so the failure is attributable.

Co-Authored-By: Claude <noreply@anthropic.com>
@jeffatgametime
jeffatgametime merged commit 293dac0 into master Jul 8, 2026
2 checks passed
@jeffatgametime
jeffatgametime deleted the count-failed-parent-nodes branch July 8, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant