Skip to content

[flutter_tools] Fix test separation between VersionFreshnessValidator and FlutterVersion.checkFlutterVersionFreshness - #191593

Merged
auto-submit[bot] merged 6 commits into
masterfrom
investigation/issue-104065
Sep 8, 2026
Merged

auto-submit[bot] merged 6 commits into
masterfrom
investigation/issue-104065

Conversation

@bkonyi

@bkonyi bkonyi commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Several tests in version_test.dart were incorrectly asserting server ping behavior on VersionFreshnessValidator.run(), which performs presentation and warning logic without network execution.

  • Add unit tests for FlutterVersion.checkFlutterVersionFreshness verifying remote ping caching, git fetch invocation, and timestamp recording on failure.
  • Isolate VersionFreshnessValidator unit tests into a dedicated group verifying warning presentation and warning timestamp tracking.
  • Update FakeCache.setStampFor to retain updated stamp data for load verification.

Fixes #104065

…r` and `FlutterVersion.checkFlutterVersionFreshness`

Several tests in `version_test.dart` were incorrectly asserting server ping behavior on `VersionFreshnessValidator.run()`, which performs presentation and warning logic without network execution.

- Add unit tests for `FlutterVersion.checkFlutterVersionFreshness` verifying remote ping caching, git fetch invocation, and timestamp recording on failure.
- Isolate `VersionFreshnessValidator` unit tests into a dedicated group verifying warning presentation and warning timestamp tracking.
- Update `FakeCache.setStampFor` to retain updated stamp data for load verification.

Fixes #104065
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 24, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 24, 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 the version freshness tests in version_test.dart by introducing helper methods to mock local and server git commands. It updates several tests to use testUsingContext to verify that the server is correctly pinged or skipped based on the state of the version stamp, and updates FakeCache to properly store the version stamp during tests. No review comments were provided, so there is no additional feedback.

bkonyi added 3 commits August 24, 2026 18:18
…tWithoutContext`

- Add optional `cache`, `logger`, and `platform` parameters to `FlutterVersion` constructor and `checkFlutterVersionFreshness`.
- Pass injected `Logger` and `Platform` to `GitTagVersion` and `_FlutterVersionFromFile`.
- Update `checkFlutterVersionFreshness` tests in `version_test.dart` to run hermetically under `testWithoutContext` without relying on ambient `AppContext`.
…on to FlutterVersion

- Update `FlutterVersion` constructor, `checkFlutterVersionFreshness`, `GitTagVersion`, and `_FlutterVersionFromFile` in `version.dart` to support optional `Cache`, `Logger`, and `Platform` parameter injection.
- Update `FakeFlutterVersion` in `config_test.dart` to match updated method signature.
… and inject dependencies via constructor

- Keep `FlutterVersion.checkFlutterVersionFreshness` parameterless to preserve interface compatibility with external implementors (e.g. google3).
- Pass optional `Cache`, `Logger`, and `Platform` to `FlutterVersion` constructor and store them as instance fields.
- Revert `FakeFlutterVersion` overrides to match parameterless signature.
@bkonyi bkonyi added CICD Run CI/CD and removed CICD Run CI/CD labels Aug 24, 2026
@bkonyi
bkonyi requested a review from chingjun August 24, 2026 23:11
chingjun
chingjun previously approved these changes Aug 29, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 29, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 29, 2026
@auto-submit

auto-submit Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/191593, because Pull request flutter/flutter/191593 is not in a mergeable state.

…ue-104065

# Conflicts:
#	packages/flutter_tools/test/commands.shard/hermetic/config_test.dart
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 8, 2026
@auto-submit

auto-submit Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/191593, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 8, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 8, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 8, 2026
Merged via the queue into master with commit e3efd66 Sep 8, 2026
28 checks passed
@auto-submit
auto-submit Bot deleted the investigation/issue-104065 branch September 8, 2026 22:36
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 8, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 9, 2026
flutter/flutter@b444e78...63b9518

2026-09-09 [email protected] Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 [email protected] Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 [email protected] Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 [email protected] [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 [email protected] [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 [email protected] [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 [email protected] [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 [email protected] Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 [email protected] [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 [email protected] [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 [email protected] [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 [email protected] [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 [email protected] [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 [email protected] Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 [email protected] et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 [email protected] Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 [email protected] [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 [email protected] [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 [email protected] [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 [email protected] [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 [email protected] Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

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:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12814)

flutter/flutter@b444e78...63b9518

2026-09-09 [email protected] Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 [email protected] Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 [email protected] Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 [email protected] [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 [email protected] [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 [email protected] [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 [email protected] [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 [email protected] Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 [email protected] [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 [email protected] [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 [email protected] [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 [email protected] [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 [email protected] [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 [email protected] Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 [email protected] et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 [email protected] Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 [email protected] [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 [email protected] [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 [email protected] [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 [email protected] [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 [email protected] Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

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:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12814)

flutter/flutter@b444e78...63b9518

2026-09-09 [email protected] Roll Packages from 9af9c60 to 36e088a (24 revisions) (flutter/flutter#192485)
2026-09-09 [email protected] Re-add Xcode and OpenJDK dependencies to macOS wasm local_engine builders (flutter/flutter#192238)
2026-09-09 [email protected] Roll Dart SDK from 77094991d1c1 to 4be1b711b4ba (5 revisions) (flutter/flutter#192453)
2026-09-09 [email protected] [material] Use super parameters in more places (flutter/flutter#192149)
2026-09-09 [email protected] [cupertino] Use super parameters in more places (flutter/flutter#192148)
2026-09-09 [email protected] [flutter_tools] Gracefully handle EROFS and write-protected file system errors (flutter/flutter#192431)
2026-09-09 [email protected] [tool] Migrate BuildIOSCommand and BuildIOSArchiveCommand to modular dependency injection (flutter/flutter#192250)
2026-09-09 [email protected] Replace more enum instances comparison to use `equality ==` instead of `identical` and update related tests (flutter/flutter#192229)
2026-09-09 [email protected] [web] Support local screenshot and golden testing in felt test (flutter/flutter#191318)
2026-09-09 [email protected] [tool] Migrate DaemonCommand and DebugAdapterCommand to modular dependency injection (flutter/flutter#190793)
2026-09-09 [email protected] [web] Support local golden testing in flutter test (flutter/flutter#191386)
2026-09-09 [email protected] [flutter_tools] Ignore widget previews outside lib/ during LSP code generation (flutter/flutter#192326)
2026-09-09 [email protected] [flutter_tools] Read package_config.json asynchronously in loadPackageConfigWithLogging (flutter/flutter#192443)
2026-09-08 [email protected] Add precacheTestImage to flutter_test and unskip web image tests (flutter/flutter#191435)
2026-09-08 [email protected] et: Fix compile_commands.json post-processing (flutter/flutter#192395)
2026-09-08 [email protected] Refactor createDebuggingOptions and option registrations to OptionDescriptor (flutter/flutter#192307)
2026-09-08 [email protected] [flutter_tools] Fix test separation between `VersionFreshnessValidator` and `FlutterVersion.checkFlutterVersionFreshness` (flutter/flutter#191593)
2026-09-08 [email protected] [tool] Migrate EmulatorsCommand to modular dependency injection (flutter/flutter#190769)
2026-09-08 [email protected] [tool] Migrate Desktop build subcommands and toolchain to modular dependency injection (flutter/flutter#190781)
2026-09-08 [email protected] [tool] Migrate Tooling and Analysis commands to modular dependency injection (flutter/flutter#190788)
2026-09-08 [email protected] Skip KGP version validation for AGP built-in Kotlin (flutter/flutter#192206)

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:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
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.

Some tests of VersionFreshnessValidator are incorrect

2 participants