-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] runs ios unit tests #18650
[web] runs ios unit tests #18650
Conversation
lib/web_ui/dev/safari.dart
Outdated
]); | ||
|
||
return process; | ||
if (mobileBrowser) { // iOS-Safari |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth documenting that we are launching the mobile Safari in a simulator, not a physical device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this line:
Uses `xcrun simctl`. It is a command line utility to control the
Simulator. For more details on interacting with the simulator
lib/web_ui/dev/safari.dart
Outdated
// TODO(nurhan): https://github.com/flutter/flutter/issues/50809 | ||
var process = await Process.start(installation.executable, [ | ||
'-F', // Open a fresh application with no persistant state. | ||
'-W', // Open to wait until the applications it opens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...it opens exits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually the comment is true. may be not very informative. It means open tool to wait until the application opens. let me add more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated all the comments, I hope they look ok now.
lib/web_ui/dev/safari.dart
Outdated
// a popup which halts the test. | ||
// The following list of arguments needs to be provided to the `open` command | ||
// to open Safari for a given URL. In summary they provide a new instance | ||
// to open, that instance to wait for opening the url until Safari launches, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is an "instance"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it means a new Safari process. From the the man tool for open
command line tool:
-n, --new Open a new instance of the application even if one is already running.
lib/web_ui/dev/test_platform.dart
Outdated
throw Exception('${runtime.name} exited before connecting.'); | ||
// For the cases where we use a delegator such as `adb` (for Android) or | ||
// `xcrun` (for IOS), these delegator processes can shut down before the | ||
// websocket is available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove onExit
from Browser
's interface. If the Browser
object does not actually represent the browser process, and its onExit
may or may not indicate the browser exiting it becomes unreliable, and the warning messages misleading. Timeouts like this only lead to flakiness.
Instead, a concrete implementation of the Browser
can internally perform these checks and handshakes as appropriate. Those implementations that launch the browser process directly will use the current method, and those using adb
or xcrun
will use something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (removed the on exit, just left comments there. I can also remove them if you think it's better)
Browser currently run checks on the exitCode and fails if it exists with non-zero code. I think that check should be enough. Since regardless of Chrome Browser of xcrun, nothing should
exit with a non-zero code.
lib/web_ui/dev/test_platform.dart
Outdated
|
||
browser.onExit.then((_) { | ||
throw Exception('${runtime.name} exited before connecting.'); | ||
// For the cases where we use a delegator such as `adb` (for Android) or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The closure passed to .then()
is empty (except the comment). Let's remove it and move the comment outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. thanks
388589d
to
46c36e9
Compare
Looks like there is an infra failure on |
This only works if the simulator is already created/booted.
(1) For this to work in local, I'll edit web_installers and add code to create/boot simulators.
(2) For this to work on LUCI, I'll change the recipe and the bot configurations.
Usage
note: I closed the previous PR:#17454 since this approach is better.