Repository navigation
[flutter_tools] Migrate resident runner, hot/cold, and TestBed tests off testUsingContext - #197256
Merged
auto-submit[bot] merged 254 commits intoNov 25, 2026
Merged
auto-submit[bot] merged 254 commits into
auto-submit[bot] merged 254 commits into
Conversation
…and inject FlutterVersion into MacOSDevice
…imulators, emulators, and LLDB
Updates buildXcodeProject in packages/flutter_tools/lib/src/ios/mac.dart to require ToolContext along with explicit Apple dependencies instead of accepting individual ToolContext fields with fallback instantiations. Also restores running SwiftPackageManagerIntegrationMigration unconditionally when building via IOSDevice and IOSSimulator.
…and-xcode-project
…ed in iOS device/emulator classes
…ix FlutterProject.fromDirectoryTest logger fallback
…, and ToolDependencies.bootstrap
…and-xcode-project
# Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
…and-simulators # Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
# Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
# Conflicts: # packages/flutter_tools/lib/src/context/tool_dependencies.dart
…ication packages Eliminates ambient `globals` usage in `ios/application_package.dart`, `macos/application_package.dart`, `windows/application_package.dart`, and `flutter_application_package.dart` by injecting `FileSystem`, `Logger`, `OperatingSystemUtils`, `Platform`, and `PlistParser` explicitly.
…devices Migrates buildLinux, buildWindows, DesktopDevice, and CustomDevice away from globals.dart to explicit dependency injection via ToolContext. Part of flutter#188471
Eliminates ambient `globals` usage from `packages/flutter_tools/lib/src/build_info.dart` by requiring explicit `Config`, `FileSystem`, `OperatingSystemUtils`, and `Platform` parameters across `getCurrentHostPlatform` and the build directory helper functions. The unreachable unsupported-host fallback in `getCurrentHostPlatform` no longer logs a warning.
Inject dependencies (Analytics, CocoaPods, Config, FeatureFlags, FileSystem, FileSystemUtils, FlutterVersion, Logger, OperatingSystemUtils, Platform, ProcessUtils, SystemClock, TemplateRenderer) explicitly into flutter_plugins.dart functions instead of reading from globals.dart.
Removes the `globals.dart` import from `packages/flutter_tools/lib/src/project.dart` by injecting `Config`, `FileSystem`, `Logger`, `TemplateRenderer`, and related dependencies explicitly into `FlutterProjectFactory`, `FlutterProject`, `AndroidProject`, and `WebProject`.
# Conflicts: # packages/flutter_tools/lib/src/linux/application_package.dart # packages/flutter_tools/lib/src/test/runner.dart
|
This pull request has been moved to a draft state because the |
chingjun
previously approved these changes
Nov 25, 2026
bkonyi
marked this pull request as ready for review
November 25, 2026 16:08
…nt-runner-and-testbed # Conflicts: # packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart # packages/flutter_tools/test/general.shard/resident_runner_test.dart
bkonyi
marked this pull request as ready for review
November 25, 2026 19:38
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors multiple test files within flutter_tools by replacing testUsingContext with standard test blocks, removing TestBed and DelegatingToolContext in favor of FakeToolContext, and explicitly passing toolContext to runners and servers. The review feedback identifies a duplicate test in web_dry_run_test.dart and suggests reusing the shared toolContext instance in hot_test.dart to simplify the code.
Comment on lines
+458
to
+489
| test('wasm dry run package config load failure', () async { | ||
| processManager.addCommand( | ||
| FakeCommand( | ||
| command: commandArgs, | ||
| exitCode: 254, | ||
| stdout: ''' | ||
| Found incompatibilities with WebAssembly. | ||
|
|
||
| package:foo/some/path.dart 6:1 - dart:html unsupported (0) | ||
| package:bar/some/path.dart 8:10 - package:js unsupported (2) | ||
| ''', | ||
| ), | ||
| ); | ||
| ), | ||
| ); | ||
|
|
||
| fs.currentDirectory | ||
| .childDirectory('.dart_tool') | ||
| .childFile('package_config.json') | ||
| .writeAsStringSync('Invalid file'); | ||
| fs.currentDirectory | ||
| .childDirectory('.dart_tool') | ||
| .childFile('package_config.json') | ||
| .writeAsStringSync('Invalid file'); | ||
|
|
||
| final Dart2WasmTarget target = createTarget(); | ||
| await target.build(environment); | ||
| final Dart2WasmTarget target = createTarget(); | ||
| await target.build(environment); | ||
|
|
||
| expect(fakeAnalytics.sentEvents, hasLength(1)); | ||
| expect(fakeAnalytics.sentEvents, hasLength(1)); | ||
|
|
||
| final Event event = fakeAnalytics.sentEvents[0]; | ||
| expect(event.eventName, equals(DashEvent.flutterWasmDryRunPackage)); | ||
| expect(event.eventData, hasLength(4)); | ||
| expect(event.eventData['result'], 'findings'); | ||
| expect(event.eventData['exitCode'], 254); | ||
| expect(event.eventData['error'], 'packageConfigNotLoaded'); | ||
| expect(event.eventData['findings'], '0,2'); | ||
| }), | ||
| ); | ||
| final Event event = fakeAnalytics.sentEvents[0]; | ||
| expect(event.eventName, equals(DashEvent.flutterWasmDryRunPackage)); | ||
| expect(event.eventData, hasLength(4)); | ||
| expect(event.eventData['result'], 'findings'); | ||
| expect(event.eventData['exitCode'], 254); | ||
| expect(event.eventData['error'], 'packageConfigNotLoaded'); | ||
| expect(event.eventData['findings'], '0,2'); | ||
| }); |
Contributor
Comment on lines
+538
to
+542
| toolContext: FakeToolContext( | ||
| artifacts: Artifacts.test(), | ||
| fs: fileSystem, | ||
| platform: FakePlatform(), | ||
| ), |
Contributor
There was a problem hiding this comment.
| devices, | ||
| debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), | ||
| target: 'main.dart', | ||
| toolContext: FakeToolContext(fs: fileSystem), |
Contributor
chingjun
approved these changes
Nov 25, 2026
This was referenced Nov 26, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Nov 26, 2026
Roll Flutter from 06f1c24345a2 to 82ec4242da79 (33 revisions) flutter/flutter@06f1c24...82ec424 2026-11-26 [email protected] Roll Dart SDK from 7663c79b8a29 to 7fcaf46b0308 (1 revision) (flutter/flutter#197465) 2026-11-26 [email protected] Roll Skia from 8bf5f2e2b358 to cef5963c1bb2 (1 revision) (flutter/flutter#197453) 2026-11-26 [email protected] Roll Dart SDK from 771539f4435a to 7663c79b8a29 (2 revisions) (flutter/flutter#197451) 2026-11-26 [email protected] Roll Skia from 535259fe7750 to 8bf5f2e2b358 (1 revision) (flutter/flutter#197449) 2026-11-26 [email protected] Roll Skia from f20b7f274ec8 to 535259fe7750 (4 revisions) (flutter/flutter#197442) 2026-11-26 [email protected] Roll Fuchsia Test Scripts from 56keLr8vaDtnH6vqW... to d5xIJpr0Hxkwjlpnr... (flutter/flutter#197441) 2026-11-26 [email protected] Roll Skia from 168ddb88c5b6 to f20b7f274ec8 (1 revision) (flutter/flutter#197438) 2026-11-26 [email protected] Roll Dart SDK from dcfa4247aa49 to 771539f4435a (1 revision) (flutter/flutter#197431) 2026-11-26 [email protected] Roll Skia from 67badb88843a to 168ddb88c5b6 (1 revision) (flutter/flutter#197430) 2026-11-26 [email protected] iOS: Pass composition order NSArray instead of std::vector (flutter/flutter#197418) 2026-11-26 [email protected] Migrate function type define to use the dart style define (flutter/flutter#197419) 2026-11-26 [email protected] iOS: Submit platform view frames from IOSExternalViewEmbedder (flutter/flutter#197411) 2026-11-26 [email protected] Roll Skia from fc1230e8afbb to 67badb88843a (1 revision) (flutter/flutter#197422) 2026-11-25 [email protected] Roll Fuchsia Linux SDK from HtAKfFLbfAQ6g96RY... to 0bgCrr76CM4IqPO0v... (flutter/flutter#197415) 2026-11-25 [email protected] Roll Dart SDK from 6155a47022d7 to dcfa4247aa49 (2 revisions) (flutter/flutter#197413) 2026-11-25 [email protected] Roll Skia from c2d40fc8f6b3 to fc1230e8afbb (2 revisions) (flutter/flutter#197407) 2026-11-25 [email protected] [flutter_tools] Add ProjectExtensionFinder and ExtensionKernelCompiler (flutter/flutter#194772) 2026-11-25 [email protected] [flutter_tools] Migrate resident runner, hot/cold, and TestBed tests off testUsingContext (flutter/flutter#197256) 2026-11-25 [email protected] [flutter_tools] Migrate create, packages, upgrade, runner, and args tests off testUsingContext (flutter/flutter#197255) 2026-11-25 [email protected] [flutter_tools] Migrate Darwin platform and build command tests off testUsingContext (flutter/flutter#197254) 2026-11-25 [email protected] [flutter_tools] Migrate Android, desktop, and web build tests off testUsingContext (flutter/flutter#197252) 2026-11-25 [email protected] iOS: Move platform view frame state to IOSExternalViewEmbedder (flutter/flutter#197362) 2026-11-25 [email protected] [flutter_tools] Migrate build target and native assets tests off testUsingContext (flutter/flutter#197246) 2026-11-25 [email protected] [flutter_tools] Migrate hermetic command tests off testUsingContext (flutter/flutter#197250) 2026-11-25 [email protected] [flutter_tools] Migrate widget preview, asset, plugin, compiler, and device tests off testUsingContext (flutter/flutter#197257) 2026-11-25 [email protected] Roll Skia from e84ecd98d9f2 to c2d40fc8f6b3 (2 revisions) (flutter/flutter#197398) 2026-11-25 [email protected] Roll Fuchsia Test Scripts from GPtykFNizlaauBqzs... to 56keLr8vaDtnH6vqW... (flutter/flutter#197382) 2026-11-25 [email protected] [flutter_tools] Remove last remaining context.get calls in lib/ (flutter/flutter#197253) 2026-11-25 [email protected] [Impeller] Subtract global pass position from backdrop filter local-to-pass transform (flutter/flutter#197324) 2026-11-25 [email protected] [Impeller] Skip mipmaps for decoded images that are resized on the GPU (flutter/flutter#197013) 2026-11-25 [email protected] [flutter_tools] Remove testWithoutContext in favor of test (flutter/flutter#197259) 2026-11-25 [email protected] Roll Packages from f455dfa to 105a874 (10 revisions) (flutter/flutter#197386) 2026-11-25 [email protected] Roll Dart SDK from 5202130a51b8 to 6155a47022d7 (1 revision) (flutter/flutter#197384) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: ...
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.
Migrates the 8 remaining resident runner, hot/cold, and web driver
testUsingContexttest files, 3TestBedweb target/devfs test files, and 3 shared helper files to plaintestwith explicitFakeToolContextand fakes:testUsingContext(,TestBed,DelegatingToolContext,testLogger, andoverrides:usages across all 14 files with explicitFakeToolContext,BufferLogger, and typed overrides (platformOverride/artifactsOverrideindevfs_web_test.dart).hot_shared.dart,resident_runner_helpers.dart, andfake_web_devfs.dart(createWebDevFSnow takesrequired ToolContext toolContext) to stop reading fromTestBedorDelegatingToolContext.test/src/context.dartandtest/src/testbed.dartimports.Part of #47161