Skip to content

Add --scan-dryrun-results for Maven subset to honor pom.xml test filtering - #1368

Merged
ItIsUday merged 1 commit into
v1from
feat/scan-dryrun-results-v1
Aug 27, 2026
Merged

Add --scan-dryrun-results for Maven subset to honor pom.xml test filtering#1368
ItIsUday merged 1 commit into
v1from
feat/scan-dryrun-results-v1

Conversation

@ItIsUday

@ItIsUday ItIsUday commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Targets v1 (the launchable command line the affected tenant uses), not main.

Why

The Maven subset command scans every *Test.java under the source roots and sends them all to the backend. But Surefire filters tests at runtime via pom.xml<excludedGroups> / <includedGroups> (JUnit 5 @Tag), <excludes> / <includes> (class globs), and profiles. The subset never sees that filtering, so it includes tests Maven will never run. At record time those tests have no matching report, which produces "missing test report" warnings and skews subset accuracy.

This is the customer-reported case behind LCHIB-693: @Tag("IntegrationTest") / @Tag("SmokeTest") tests excluded via <excludedGroups>IntegrationTest,SmokeTest</excludedGroups> still get sent to the subset.

What

New --scan-dryrun-results flag on subset ... maven. Instead of scanning source files, it parses **/target/surefire-reports/TEST-*.xml and sends the fully-qualified class name from each report's root name attribute.

The workflow is to run a JUnit 5 dry run first:

mvn test -Djunit.platform.execution.dryRun.enabled=true
smart-tests subset ... maven --scan-dryrun-results

Limitations

  • JUnit 5 only. The dry-run parameter is a JUnit Platform feature; JUnit 4 @Category and TestNG groups are not covered.

…ering

The Maven subset command scans all *Test.java files and sends them to the
backend, ignoring Surefire filtering (excludedGroups, excludes, profiles).
Excluded tests then have no matching report at record time, producing
"missing test report" warnings and skewing subset accuracy.

--scan-dryrun-results parses target/surefire-reports/TEST-*.xml instead of
scanning source files. Run `mvn test -Djunit.platform.execution.dryRun.enabled=true`
first: Surefire applies all its filtering before the JUnit 5 dry run, so only
the classes Maven would actually run get a report. JUnit 5 only.

Hard-fails when no reports are found rather than silently sending an empty
subset.

@Konboi Konboi 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.

LGTM

@ItIsUday
ItIsUday merged commit 1990fed into v1 Aug 27, 2026
14 checks passed
@ItIsUday
ItIsUday deleted the feat/scan-dryrun-results-v1 branch August 27, 2026 09:10
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.

2 participants