Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upA Hub API that can query all running sessions. #6158
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shs96c
requested changes
Jul 15, 2018
This is missing tests, so it'll be easy to introduce accidental regressions.
The approach taken here is very "bare metal": we're basically exposing the internals of the current grid to the world. Is this the approach we want to take, or would we prefer something that explains the domain better? I'm perfectly happy if the answer is "bare metal to get us off the ground", as I think we're allowed to iterate on Grid functionality with greater freedom than anything on the client side.
| } catch (IOException e) { | ||
| throw new GridException(e.getMessage()); | ||
| } | ||
| return new TreeMap<>(); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
krmahadevan
Jul 16, 2018
Contributor
Fixed it. The status gets flipped to false if there was any difficulty in extracting sessions info
krmahadevan
Jul 16, 2018
Contributor
Fixed it. The status gets flipped to false if there was any difficulty in extracting sessions info
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
krmahadevan
Jul 16, 2018
Contributor
This is missing tests, so it'll be easy to introduce accidental regressions.
I was initially confused as to what sort of tests I add because this new servlet internally makes a call to WebDriverServlet running in the node. So didn't know how to fake that out. Ended up writing a E2E test which tests the functionality by spinning a grid hub and node.
The approach taken here is very "bare metal": we're basically exposing the internals of the current grid to the world. Is this the approach we want to take, or would we prefer something that explains the domain better? I'm perfectly happy if the answer is "bare metal to get us off the ground", as I think we're allowed to iterate on Grid functionality with greater freedom than anything on the client side.
The ask in #6070 was explicitly to have the capability of listing out all the sessions running in the Hub via an API. Please let me know if there's any other way of giving this capability. I will alter my PR accordingly.
I have addressed the review comments. Please help take a look.
I was initially confused as to what sort of tests I add because this new servlet internally makes a call to
The ask in #6070 was explicitly to have the capability of listing out all the sessions running in the Hub via an API. Please let me know if there's any other way of giving this capability. I will alter my PR accordingly. I have addressed the review comments. Please help take a look. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
krmahadevan
Jul 24, 2018
Contributor
@shs96c - thank you so much for merging the other two PRs. Can you please check if this one needs any additional work or if it can be merged as well ?
|
@shs96c - thank you so much for merging the other two PRs. Can you please check if this one needs any additional work or if it can be merged as well ? |
p0deje
added
C-java
C-grid
and removed
C-java
labels
Jul 26, 2018
krmahadevan
added some commits
Jul 14, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Rebased off of |
krmahadevan commentedJul 14, 2018
Closes #6070
The API can be accessed via
http://IP:Port/grid/api/sessions.
Both GET and POST are supported and result in the
same behavior.
A typical response can look like below (intentionally
trimmed the capabilities to reduce verbosity)
{ "proxies": [ { "proxyId": "http://192.168.1.6:5555", "proxyRemoteHost": "http://192.168.1.6:5555", "sessions": { "status": 0, "value": [ { "id": "df8aa16d-1d52-2e43-b584-2f9df586b0f3", "capabilities": {} }, { "id": "f85f5641-e6de-3642-913a-a45aafdb85ad", "capabilities": {} } ] } }, { "proxyId": "http://192.168.1.6:5556", "proxyRemoteHost": "http://192.168.1.6:5556", "sessions": { "status": 0, "value": [ { "id": "f4df4fbd-96ee-e042-ab43-40a33698d1e9", "capabilities": {} } ] } } ], "success": true }Xin the preceding checkbox, I verify that I have signed the Contributor License Agreement