Forward-port --scan-dryrun-results (Maven subset) from v1 to main - #1370
Open
ItIsUday wants to merge 12 commits into
Open
Forward-port --scan-dryrun-results (Maven subset) from v1 to main#1370ItIsUday wants to merge 12 commits into
ItIsUday wants to merge 12 commits into
Conversation
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
…rent ratio with --target
…sampling-target backport --fallback-sampling-target option so users can specify different ratio with --target
…mands back-ported from v2
…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.
Konboi
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 undersmart_tests/, so net change is just the 5 dryrun feature files. Supersedes #1363.