Skip to content

[flutter_tools] Support boolean selectors and multiple tag options in test command (#189193) - #190541

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
bkonyi:fix-189193
Aug 5, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
bkonyi:fix-189193

Conversation

@bkonyi

@bkonyi bkonyi commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #189193

In TestCommand, --tags (-t) and --exclude-tags (-x) were registered using addOption(...) instead of addMultiOption(...). This scalar option definition retained only the last CLI occurrence when passed multiple times (-t a -t b became 'b'). Additionally, default comma splitting in package:args mangled composite boolean selector expressions (||, &&, !) before forwarding arguments to package:test.

This PR migrates --tags and --exclude-tags to addMultiOption(..., splitCommas: false) in TestCommand and updates FlutterTestRunner to forward all --tags and --exclude-tags values sequentially to dart test.

Testing

  • Added hermetic regression test passes boolean selectors and multiple tags/exclude-tags through to package:test in packages/flutter_tools/test/commands.shard/hermetic/test_test.dart.

… 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
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 4, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 4, 2026

@gemini-code-assist gemini-code-assist Bot 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.

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.

@bkonyi
bkonyi requested a review from chingjun August 4, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flutter test --tags does not correctly parse boolean selectors

2 participants