-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] using pkill to quit safari #17533
Conversation
809d68b
to
f399a6a
Compare
@digiter we need to manually give permission to Terminal to control Safari. System Preferences > Security & Privacy > Privacy > Automation. (Adding Terminal to Safari) |
I don't think we check in binaries in our repos /cc @Hixie to confirm the policy What's the source of the |
@godofredoc See Nurhan's comment above, I'm worried about that the setting of "System Preferences > Security & Privacy > Privacy > Automation. (Adding Terminal to Safari)" can only be set via GUI and not possible to be automated via scripts. Which would increase maintenance burden as we will have to do that on every web engine bot. My suggestion is simply call |
Besides, granting the Terminal app to control safari may not work, as LUCI recipes don't run in the Terminal app AFAIU. |
Ah, I didn't know that. We can add that application to the permission list from settings if we want to follow this path. On the hand @yjbanov also does not want to use applescript since it is not saved as text in the source control repo. |
I'd suggest to use kill instead of adding something that requires configurations to the bots. Manual configurations are expensive and error prone, besides mac machines are configured by chromium team and we have limited access to them. |
My gut feeling is that safaridriver is the best way to control the browser rather than |
I am trying it with safari driver desktop now. I'll let you know if I'm able to close the browsers (cleanup tabs) |
The driver is not usable for quitting safari. Delete session does not close the Safari Desktop. I closes the session successfully yet the browser stays open. I'll go with Tong's suggestion |
Does closing the session close the tab? It is OK if the Safari process stays open as long as opening new sessions after closing old sessions does not result in accumulation of new tabs or new processes.
If it works, then sure! |
One downside is that when testing locally it will be closing unrelated browsers that you might be using for something else. |
Please check the current version. I am closing the Safari for CI environments (which will fix the issue), I'm only printing an info message for the local developers. |
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.
LGTM, but it would be really nice to restore separation between commands. Can be done in a separate PR.
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.
LGTM after addressing Yegor's comments.
Merging the PR. I checked all the tests are successfully ran. Looks like LUCI is delaying sending the results to github. |
Thanks I addressed the comments. |
Thanks I addressed the comments. |
* adding an apple script to quit safari * making changes to utils and adding cleanup after unit tests failed * switch saai quit to pkill instead of applescript * adding toolexception * adding a cleanup function option to felt. * removing unnecassary await's added for the previos version of the PR * removing unnecassary async * fix analyze error
felt was leaving lots of Safari tabs open after running unit test.
Quit safari after running felt with safari.
I used applescript since it is the most reliable (and easy way of) controlling MacOs applications. It is very easy to give commands to give commands to build in applications such as Safari, Finder, Xcode.
One time permission to run 'osascript' from the terminal should be given to luci bots before merging the PR.
Fixes flutter/flutter#53724