Skip to content

Enhancement/lchib 614 utilize surefire report extended by rerun feature v2 - #1407

Merged
jothikumar-CB merged 6 commits into
mainfrom
enhancement/LCHIB-614-utilize-surefire-report-extended-by-rerun-feature-v2
Oct 23, 2026
Merged

jothikumar-CB merged 6 commits into
mainfrom
enhancement/LCHIB-614-utilize-surefire-report-extended-by-rerun-feature-v2

Conversation

@jothikumar-CB

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

Copy link
Copy Markdown
Contributor
  • Forward-ports the Surefire <flakyFailure>/<flakyError>/<rerunFailure>/<rerunError> support from v1 (PR enhancement/LCHIB-614: utilize surefire report extended by rerunFailingTests feature #1404) into main's rebranded smart_tests codebase.
  • smart_tests/commands/record/case_event.py — CaseEvent.from_case_and_suite now expands a single into multiple case events when Surefire's rerun/flaky tags are present (N FAILED + 1 final PASSED for flaky tests; 1+N FAILED for tests that fail on every rerun), with duration correctly attributed to the attempt that semantically owns it, not just whichever is positionally first. Also fixes CaseEventType's long-standing inaccurate Dict[str, str] type hint to Dict[str, Any] — main had the same latent bug independently.
  • smart_tests/commands/record/tests.py — the yield → yield from call-site change, plus the summarize_case_events() extraction (pulled out of a previously-untestable nested closure into a standalone, directly-testable function) so the "Tests found/passed/failed" summary table counts unique tests instead of raw events.
  • No Intake API / data model changes — same reasoning as the original v1 PR: flakiness is detected purely from a FAILED + PASSED pair sharing a testPath within one session, which the backend already supports.

@jothikumar-CB
jothikumar-CB requested review from ItIsUday and Konboi and a balanced review from Copilot October 22, 2026 11:47
@jothikumar-CB jothikumar-CB self-assigned this Oct 22, 2026
@jothikumar-CB jothikumar-CB added the Smart Tests CLI The next gen CLI label Oct 22, 2026

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.

🟡 Changes recommended

Retry diagnostics can be lost, and summary aggregation can hide independent failures or crash on supported raw test paths.

3 open issues
What changed in this PR

This PR extends Smart Tests CLI recording to capture individual attempts from Maven Surefire rerun reports and summarize retry results as logical tests.

Changes:

  • Expand flaky and rerun XML elements into individual attempt events.
  • Group recorded events by test path for summary counts while summing durations.
  • Add Maven report fixtures, expected payloads, and summary tests.
File Description
tests/​test_runners/​test_maven.py Adds integration tests for four retry report variants.
tests/​data/​maven/​reports-rerun-fail/​TEST-rerun-fail.xml Adds an always-failing retry report.
tests/​data/​maven/​reports-rerun-error/​TEST-rerun-error.xml Adds a repeated-exception retry report.
tests/​data/​maven/​reports-flaky/​TEST-flaky.xml Adds a failure-then-success report.
tests/​data/​maven/​reports-flaky-error/​TEST-flaky-error.xml Adds an exception-then-success report.
tests/​data/​maven/​record_test_rerun_fail_result.json Defines expected failed-attempt events.
tests/​data/​maven/​record_test_rerun_error_result.json Defines expected exception-attempt events.
tests/​data/​maven/​record_test_flaky_result.json Defines failed attempts followed by success.
tests/​data/​maven/​record_test_flaky_error_result.json Defines an exception attempt followed by success.
tests/​commands/​record/​test_tests.py Tests summary counts and durations with retries.
smart_tests/​commands/​record/​tests.py Flattens attempt events and adds grouped summaries.
smart_tests/​commands/​record/​case_event.py Parses Surefire extensions into attempt events.

Review effort: Balanced

Comment thread smart_tests/commands/record/case_event.py
Comment thread smart_tests/commands/record/tests.py
Comment thread smart_tests/commands/record/tests.py
@jothikumar-CB
jothikumar-CB merged commit 80a88ec into main Oct 23, 2026
4 checks passed
@jothikumar-CB
jothikumar-CB deleted the enhancement/LCHIB-614-utilize-surefire-report-extended-by-rerun-feature-v2 branch October 23, 2026 05:32
@github-actions github-actions Bot mentioned this pull request Oct 23, 2026
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.

3 participants