Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable tests to perform actions on behalf of the host (using service extensions) #584

Closed
bartekpacia opened this issue Nov 9, 2022 · 8 comments
Labels
feature New feature request

Comments

@bartekpacia
Copy link
Contributor

bartekpacia commented Nov 9, 2022

I want to embed an HTTP server in patrol_cli. Requests to that server would run shell commands (e.g adb, flutter screenshot) from within Dart test code running on a device.

This will enable us to solve the following:

I'd like to use gRPC for this (we already use it for Flutter <--> native communication within a device).

See also:

  • this comment where the initial idea for this proposal was born

cc: @mateuszwojtczak, @jakubfijalkowski, @shilangyu

@bartekpacia bartekpacia added the feature New feature request label Nov 9, 2022
@jakubfijalkowski
Copy link
Member

jakubfijalkowski commented Nov 9, 2022

Since you already have gRPC there, and the use case for this is somewhat limited, maybe it is worth considering client streaming?

@bartekpacia
Copy link
Contributor Author

Could you elaborate?

@jakubfijalkowski
Copy link
Member

gRPC is unidirectional with a single exception - client streaming. You then don't need to open additional connection to send limited commands to the client.

I think this comment is somewhat irrelevant - I missed what parties you want to be connected. Sorry!

When it comes to CLI <-> Dart's part of the app comms, I personally would go with Dart VM's observatory service extension - there already is CLI <-> Dart communication (although somewhat hidden - it is maintained by the Flutter Driver but, if FD is used directly, you can attach to it) and then you can use events to send requests from tests to the CLI. This will be, IMO, much more Dart-native.

@bartekpacia
Copy link
Contributor Author

bartekpacia commented Nov 9, 2022

@jakubfijalkowski Whoa, this is exactly a big-brain kind of idea I'd expect from you :D

This approach sounds very interesting, and I think I like it.

Concern:
It'll require more research from me than what I wrote in the first post (embedding a gRPC in the CLI), and I don't know what benefits we'll gain aside from being more Dart-native.

@jakubfijalkowski
Copy link
Member

The main big advantage here is that you will need to maintain only one connection. With separate gRPC server you will have to have two of them, which gets funny when only one of them breaks in a silent manner ;P

@bartekpacia
Copy link
Contributor Author

Another use case for the HTTP server:

@bartekpacia bartekpacia changed the title Add HTTP server to patrol_cli Enable tests to perform actions on behalf of the host (using service extensions) Nov 15, 2022
@bartekpacia bartekpacia pinned this issue Nov 15, 2022
@bartekpacia bartekpacia unpinned this issue Dec 2, 2022
@bartekpacia
Copy link
Contributor Author

Patrol 1.0 works only inside the host app, so this is not longer relevant. In the future, we'll research how we can add host feautres back, but they will only work when the host is available (so, for example, not on Firebase Test Lab).

See also #661.

@bartekpacia bartekpacia closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

2 participants