Skip to content

Conversation

@matanlurey
Copy link
Contributor

Prospective implementation, as a proof of concept, for #160043.

This re-uses TestGoldenComparator, which was written for Flutter Web (which, similar to Android and iOS, can't do golden-file comparisons on "device"), but this time would apply them to Android and iOS builds as well (though in this PR, no conditional logic is applied).

What works:

  • The client (device) sends events to the VM service
  • The host (flutter_tools CLI) listens on the VM service

What doesn't:

  • The host (flutter_tools CLI) doesn't get the event the client sent

The console output at the current commit looks like this:

✓ Built build/app/outputs/flutter-apk/app-debug.apk
Installing build/app/outputs/flutter-apk/app-debug.apk...          661ms
_handleStartedDevice(http://127.0.0.1:49570/_CTw0sDgEv4=/, 0)
Connecting
Listening
00:13 +0: can use matchesGoldenFile with integration_test                                                                                                                                                                                             
>>> Posting 1|integration_test_matches_golden_file.png|37911 bytes

(nothing else ever happens until timeout)

I'm perhaps doing something wrong, so I'll get some help tomorrow.

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. f: integration_test The flutter/packages/integration_test plugin labels Dec 12, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2024
…S) integration tests (#160215)

Part of #160043, makes it
easier to add #160131.

This PR has no functional changes to any of the code, but does refactor
both the code and tests:

- Makes a number of always non-null but not migrated to non-null
properties, well, not-null
- Creates two concrete methods (`update` and `compare` versus a
positional nullable boolean)
- Uses type signatures instead of `String?` to explain the possible
results of the methods
- Renames the mysterious `shellPath` variable to `flutterTesterBinPath`
- Expands and rewrites internally-facing doc comments
- Moves `WebRenderer` environment variable setting to
`flutter_web_platform.dart`
- Makes the tests have less duplication, and check for update/compare
cases

After this PR, I can use it in the non-web branch of the Flutter tool
without any hacks or TODOS :)

/cc @eyebrowsoffire (trivial web refactoring), @camsim99 (changes being
made to tool).
@matanlurey matanlurey closed this Dec 19, 2024
@matanlurey matanlurey deleted the vm-service-matches-golden branch December 19, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant