Skip to content

enhancement/LCHIB-614: fix nested maven test usecase - #1409

Open
jothikumar-CB wants to merge 1 commit into
v1from
enhancement/LCHIB-614-fix-nested-maven-test-scenario
Open

jothikumar-CB wants to merge 1 commit into
v1from
enhancement/LCHIB-614-fix-nested-maven-test-scenario

Conversation

@jothikumar-CB

@jothikumar-CB jothikumar-CB commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
  • Fixes two correctness bugs flagged in code review on enhancement/LCHIB-614: utilize surefire report extended by rerunFailingTests feature #1404 (the original Surefire rerun/flaky feature): the post-run "Tests found / passed / failed" summary could silently merge two different tests into one entry, or crash with a KeyError.
  • Nested-class collision: Maven's $-stripping for @nested JUnit5 classes meant two independent tests (e.g. Outer$Failing.sameName and Outer$Passing.sameName) shared the same normalized testPath, so a pass and a fail were reported as a single test instead of two.
  • Raw-runner collision/crash: TestPathComponent is an arbitrary bag of string attributes and isn't required to have type/name. The raw runner accepts such paths, which made the summary either raise KeyError (after results were already uploaded) or silently merge paths that only differed in some other attribute.
  • Both are fixed by tagging every event derived from the same original with an internal-only UUID (BATCH_ID_KEY), set in CaseEvent.from_case_and_suite. summarize_case_events groups by this id directly for JUnit-based events, and falls back to the full sorted attribute set of each testPath component (not just type/name) for events from runners that never set this key (raw, pytest, nunit, etc.).
  • The tag is internal-only and stripped in payload() before upload — it never reaches the server, and CaseEvent.create() itself (called directly by 9 other runners) is untouched.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Existing tests do not exercise either corrected grouping branch, leaving insufficient regression assurance for automated approval.

1 open issue
What changed in this PR

This PR corrects post-run test summaries introduced with Surefire retry support, keeping distinct nested JUnit tests separate and supporting arbitrary raw-runner path attributes.

Changes:

  • Assigns an internal UUID to events from each original JUnit testcase.
  • Groups summaries by that UUID, falling back to complete path attributes for other runners.
  • Removes the internal identifier before uploading events.
File Description
launchable/​commands/​record/​tests.py Updates summary grouping and strips internal identifiers from upload payloads.
launchable/​commands/​record/​case_event.py Tags each testcase’s derived events with a shared UUID.

Review effort: Balanced

Comment thread launchable/commands/record/tests.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Smart Tests CLI The next gen CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants