Skip to content

Forward-port --scan-dryrun-results (Maven subset) from v1 to main - #1370

Open
ItIsUday wants to merge 12 commits into
mainfrom
forward-port-dryrun-results
Open

Forward-port --scan-dryrun-results (Maven subset) from v1 to main#1370
ItIsUday wants to merge 12 commits into
mainfrom
forward-port-dryrun-results

Conversation

@ItIsUday

Copy link
Copy Markdown
Contributor

Forward-ports #1368 into main via git merge v1 (per the v1 → v2 porting guide). The other 6 v1-only commits already exist on main under smart_tests/, so net change is just the 5 dryrun feature files. Supersedes #1363.

takanabe and others added 12 commits June 11, 2026 17:20
backport v2 merged code from #1308
Click's type system works like this:

1. User runs: launchable subset --target 50%
2. Click receives the raw string "50%"
3. Click sees type=PERCENTAGE on the option, so it calls PercentageType.convert("50%", ...)
4. convert() parses "50%" and returns 0.5
5. Click passes 0.5 as target to subset()

PercentageType is called a "converter" because it converts the raw CLI string into a Python value. It's Click's extension point for custom argument types, which similar to how type=int makes Click convert "5" to 5. PercentageType does the same for percentages. The key point: convert() runs inside Click's internals, not in your code. Your function only ever sees the return value of convert(), which is a float. PercentageType itself never appears as a value anywhere in your code. This is why Optional[PercentageType] is misleading. It suggests the function receives a PercentageType instance, but it actually receives whatever convert() returned, which is float.
…k-for-v1

Add fallback-mode option for subset
…sampling-target

backport  --fallback-sampling-target option so users can specify different ratio with --target
…ncy-v1

Display number of new tests for subset and New column for inspect commands back-ported from v2
…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.
Add --scan-dryrun-results for Maven subset to honor pom.xml test filtering
Forward-ports the v1 change (#1368) into main per the CLI v1 -> v2
forward-porting guide. The other 6 v1-only commits (fallback-mode,
fallback-sampling-target, inspect New column, type/format fixes) already
exist on main under smart_tests/, so their conflicts were resolved by
keeping main's version; only the --scan-dryrun-results feature is new here.

Net change vs main is limited to the smart_tests/typer form of the flag:
parse target/surefire-reports/TEST-*.xml from a JUnit 5 dry run so Surefire's
pom.xml filtering (excludedGroups/excludes/profiles) is honored.
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.

3 participants