Skip to content

[flutter_tools] Verify local engine option propagation across tool commands and DI - #192510

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
bkonyi:test_local_engine_propagation
Oct 7, 2026
Merged

auto-submit[bot] merged 10 commits into
flutter:masterfrom
bkonyi:test_local_engine_propagation

Conversation

@bkonyi

@bkonyi bkonyi commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds tests verifying that local engine options specified via CLI flags or artifacts are properly propagated across flutter_tools commands and dependency injection bootstrapping, addressing #192361 (comment). Also refactors Artifacts.getLocalEngine to make cache, fileSystem, operatingSystemUtils, platform, and processManager required named parameters, eliminating ambient globals.* fallbacks.

Related Issues

Tests

  • Hermetic unit tests in packages/flutter_tools/test/commands.shard/hermetic/ (assemble_test.dart, build_ios_test.dart, build_linux_test.dart, build_macos_test.dart, build_web_test.dart, build_windows_test.dart)
  • Unit tests in packages/flutter_tools/test/general.shard/ (bundle_builder_test.dart, context/dependency_injection_test.dart, runner/flutter_command_runner_test.dart)
  • Integration test in packages/flutter_tools/test/integration.shard/build_linux_config_only_test.dart

…mmands and DI

Tests that local engine options specified via CLI flags or artifacts
are properly propagated to where they are needed across the flutter tool:

- Hermetic unit tests for `AssembleCommand`, `BuildLinuxCommand`,
  `BuildWindowsCommand`, `BuildMacOSCommand`, `BuildIOSCommand`, and
  `BuildWebCommand`.
- Unit tests for `BundleBuilder`, `ToolDependencies.bootstrap`, and
  `FlutterCommandRunner`.
- Synthetic integration test for `flutter build linux --config-only`.
- Refactored `Artifacts.getLocalEngine` to require all dependencies explicitly,
  eliminating ambient context fallbacks.

Addresses flutter#192361 (comment).
@bkonyi
bkonyi requested review from a team as code owners September 9, 2026 19:36
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 9, 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 refactors Artifacts.getLocalEngine to accept dependencies as required named parameters instead of relying on global variables, and updates FlutterCommandRunner to pass these dependencies. It also adds tests across multiple platforms to verify that local engine options are propagated to the build system environment and generated configuration files. Feedback is provided to use fileSystem.path.join in assemble_test.dart to prevent test failures on Windows due to hardcoded path separators.

Comment thread packages/flutter_tools/test/commands.shard/hermetic/assemble_test.dart Outdated
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-ios Owned by iOS platform team team-macos Owned by the macOS platform team team-windows Owned by the Windows platform team team-linux Owned by the Linux platform team labels Sep 9, 2026
@bkonyi
bkonyi requested a review from cbracken September 9, 2026 19:58
@vashworth
vashworth requested review from okorohelijah and removed request for cbracken September 21, 2026 21:49
Comment thread packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart Outdated
Comment thread packages/flutter_tools/lib/src/artifacts.dart Outdated
Comment thread packages/flutter_tools/test/general.shard/context/dependency_injection_test.dart Outdated
bkonyi added 3 commits October 6, 2026 15:09
…_propagation

# Conflicts:
#	packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart
…ependencies

Avoids importing ToolContext into Artifacts to prevent an import cycle and decouples the Artifacts type from the DI container.
@bkonyi
bkonyi requested a review from okorohelijah October 6, 2026 15:49
… Linux config-only test

Formats test files with the updated cached Dart SDK (3.14.0-309.0.dev) to satisfy format.dart and runs pub get prior to flutter build linux --config-only --no-pub in build_linux_config_only_test.dart so generated_plugins.cmake exists regardless of test execution order.
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 7, 2026
Merged via the queue into flutter:master with commit 5c138bc Oct 7, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-ios Owned by iOS platform team team-linux Owned by the Linux platform team team-macos Owned by the macOS platform team team-windows Owned by the Windows platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants