Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Oct 18, 2020

Description

Overhaul of flutter drive in order to deliver a better experience, namely:

  • flutter run and flutter drive now share more flags, so code paths that were previously only testable on run are now testable on drive.
    • Removes web-initialize-platform as this is no longer used
  • flutter drive correctly sets up a logger that shows native exceptions, by connecting to the vm service.
  • VM service connection now provides access to memory info without launching devtools (only for debug/profile mode)

Web changes

Passes on the one test in the repo, otherwise the webdriver code has been isolated as much as possible

Additional NNBD related bug fixes:

No longer passes --enable-experiment to the test script. (FYI @blasten ). earlier we might have assumed that the flutter gallery benchmarks would be migrated along side the app and flutter driver, but only the app under test needs to be migrated. The test scripts should never be run with the experiment.

@jonahwilliams jonahwilliams changed the title Drive service [flutter_tools] refactor drive launch into separate service, split by mobile+desktop and web Oct 19, 2020
@jonahwilliams jonahwilliams marked this pull request as ready for review October 19, 2020 20:08
@jonahwilliams
Copy link
Contributor Author

@yjbanov can you double check the web changes (or find someone else for them) - I ran through the web test on cirrus and it works with this change.

@jonahwilliams jonahwilliams requested review from angjieli and removed request for yjbanov October 19, 2020 22:50
dartSdkPath: globals.artifacts.getArtifactPath(Artifact.engineDartBinary),
);
final DriverService driverService = _flutterDriverFactory.createDriverService(web);
// if (web) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

if (debuggingOptions.debuggingEnabled) {
observatoryDiscovery = ProtocolDiscovery.observatory(
await getLogReader(),
await AdbLogReader.createLogReader(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment why not to use getLogReader?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

dartSdkPath: globals.artifacts.getArtifactPath(Artifact.engineDartBinary),
);
final DriverService driverService = _flutterDriverFactory.createDriverService(web);
// if (web) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

if (await _fileSystem.type(testFile) != FileSystemEntityType.file) {
throwToolExit('Test file not found: $testFile');
}
final Device device = await findTargetDevice(includeUnsupportedDevices: stringArg('use-application-binary') == null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is deviceDiscoveryTimeout now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +99 to +100
fileSystem: globals.fs,
logger: globals.logger,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these null at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the only interfaces that can't be injected at this point are those that depend on Cache/Artifacts/Version since those are still constructed when the first FlutterCommand is executed

Copy link
Contributor

@angjieli angjieli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonahwilliams
Copy link
Contributor Author

Updated to include device disposal from #68655

@jonahwilliams
Copy link
Contributor Author

G3Fix is CL/338167561

@jonahwilliams jonahwilliams requested a review from jmagman October 21, 2020 18:41
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this and making it testable. I was always scared to touch drive code, it was spaghetti

@jonahwilliams jonahwilliams merged commit 2e75f52 into flutter:master Oct 22, 2020
@jonahwilliams jonahwilliams deleted the drive_service branch October 22, 2020 22:07
jonahwilliams pushed a commit that referenced this pull request Oct 23, 2020
…split by mobile+desktop and web (#68451)"

This reverts commit 2e75f52.
jonahwilliams pushed a commit that referenced this pull request Oct 23, 2020
…split by mobile+desktop and web (#68451)" (#68845)

This reverts commit 2e75f52.
@jonahwilliams jonahwilliams restored the drive_service branch October 23, 2020 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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.

3 participants