Repository navigation
[flutter_tools] Support boolean selectors and multiple tag options in test command (#189193) - #190541
Merged
Merged
Conversation
… test command Update `--tags` (`-t`) and `--exclude-tags` (`-x`) in `TestCommand` to use `addMultiOption` with `splitCommas: false` instead of `addOption`. Previously, passing multiple tag options would discard all but the last tag, and single-option parsing prevented complex boolean selector expressions from being parsed and forwarded correctly. Update `FlutterTestRunner.runTests` and `FlutterTestRunner.runTestsBySpawningLightweightEngines` to accept `List<String>` for `tags` and `excludeTags`, forwarding all tag selectors to `dart test`. Fixes flutter#189193
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the test command in flutter_tools to support multiple --tags and --exclude-tags options. The command-line options are changed from single options to multi-options, and the internal runner interfaces and implementations are updated to accept and forward lists of tags. A hermetic test is added to verify that multiple tags and boolean selectors are correctly passed to the underlying test package. There are no review comments, so no additional feedback is provided.
chingjun
approved these changes
Aug 5, 2026
This was referenced Aug 6, 2026
This was referenced Aug 11, 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.
Fixes #189193
In
TestCommand,--tags(-t) and--exclude-tags(-x) were registered usingaddOption(...)instead ofaddMultiOption(...). This scalar option definition retained only the last CLI occurrence when passed multiple times (-t a -t bbecame'b'). Additionally, default comma splitting inpackage:argsmangled composite boolean selector expressions (||,&&,!) before forwarding arguments topackage:test.This PR migrates
--tagsand--exclude-tagstoaddMultiOption(..., splitCommas: false)inTestCommandand updatesFlutterTestRunnerto forward all--tagsand--exclude-tagsvalues sequentially todart test.Testing
passes boolean selectors and multiple tags/exclude-tags through to package:testinpackages/flutter_tools/test/commands.shard/hermetic/test_test.dart.