feat: Support --target default to run only untargeted tests#25
Merged
haugoug merged 1 commit intogvsoc:mainfrom Mar 15, 2026
Merged
feat: Support --target default to run only untargeted tests#25haugoug merged 1 commit intogvsoc:mainfrom
haugoug merged 1 commit intogvsoc:mainfrom
Conversation
Adds 'default' as a special target keyword: - `gvtest --target default`: runs only tests that have no target defined in gvtest.yaml (untargeted tests). - `gvtest --target default --target X`: runs both untargeted tests and tests for target X. - `gvtest --target X`: runs only tests for target X (unchanged). - `gvtest` (no --target): runs everything (unchanged). Implementation: - Track whether --target was explicitly passed via _cli_targets_explicit flag (can't rely on checking the value since 'default' is also the no-target default). - Enqueue filter checks both fallback status and target name membership in the requested list. - _resolve_targets_for_dir filters YAML targets by the non-'default' entries in target_names. Added 2 tests for --target default behavior.
e47cc91 to
c1c64d9
Compare
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.
Feature
--target defaultnow selects only tests that have no target defined in gvtest.yaml.gvtestgvtest --target Xgvtest --target defaultgvtest --target default --target XImplementation
_cli_targets_explicitflag tracks whether--targetwas passed (can't check the value since['default']is also the no-flag default)TestCommon.enqueue()handles all combinations: fallback tests only run whendefaultis requested, real targets only run when their name is requested_resolve_targets_for_dir()filters YAML targets by the non-defaultentries in the target listTests
2 new tests, 144 total passing.