Open skidnight opened 1 year ago
@skidnight can you please share full logs
These are the hub/node logs from a run of one of my tests across two devices. It's probably worth noting the hub is running in a docker container without access to device connections, if that makes a difference. appium-hub.log appium-node.log
Please attach logs as gist. Hard to read as file
@sudharsan-selvaraj Can you check this please? Error is from appium-dashboard
I am also experiencing the same issue with device-farm@8.4.6. Can you please let me know how to display the dashboard data for the devices connected to the node using what method?
To fix this problem arbitrarily, I applied the following method.
diff --git a/src/app/routers/grid.ts b/src/app/routers/grid.ts
index 2c46c0f..ec82816 100644
--- a/src/app/routers/grid.ts
+++ b/src/app/routers/grid.ts
@@ -35,8 +35,10 @@ async function getDevices(request: Request, response: Response) {
deviceSessionMap[session.udid].push(session);
});
devices = devices.map((d) => {
- d.dashboard_link = `${dashboardPluginUrl}?device_udid=${d.udid}&start_time=${SERVER_UP_TIME}`;
- d.total_session_count = deviceSessionMap[d.udid]?.length || 0;
+ if (d.dashboard_link === null) {
+ d.dashboard_link = `${dashboardPluginUrl}?device_udid=${d.udid}&start_time=${SERVER_UP_TIME}`;
+ }
+ d.total_session_count = deviceSessionMap[d.udid]?.length || d.total_session_count;
return d;
});
}
diff --git a/src/data-service/device-service.ts b/src/data-service/device-service.ts
index e9b80e9..b35c722 100644
--- a/src/data-service/device-service.ts
+++ b/src/data-service/device-service.ts
@@ -53,6 +53,14 @@ export async function addNewDevice(devices: IDevice[], host?: string): Promise<I
}
} else {
log.debug(`Device "${device.udid}" already exists in database`);
+ (await ADTDatabase.DeviceModel)
+ .chain()
+ .find({ udid: device.udid })
+ .update(function (d: IDevice) {
+ d.host = device.host;
+ d.dashboard_link = device.dashboard_link;
+ d.total_session_count = device.total_session_count;
+ });
}
});
Using the data delivered by node on "/device-farm/api/register?type=add", we update the dashboard_link and total_session_count of the devices connected to the node. And when taking the data about devices from the dashboard, I pass the dashboard_link and total_session_count as they are.
In this way, I solved the problem arbitrarily.
Currently appium-dashboard plugin doesn't work well with HUB+NODE setup. All the session related data can only be views from the same appium process. Even with the above changes i'm not sure if the dashboard will still show the node details in the hub.
@sudharsan-selvaraj I am also not sure that it displays the information of Nodes perfectly on the hub. Also, I don't know what problems it will cause. However, I have confirmed that it operates at the level required in the environment I tested.
In this regard, I would like to inquire about something. Will you support the Dashboard in HUB + NODE environment? If you plan to apply, how would you like to display the Node's information? There seems to be a way to receive and store all data from the Node in the Hub and then display it in the Hub or connect it to the Node's dashboard.
any update on this? @sudharsan-selvaraj
I have a hub setup with currently a single node connected that is running a variety of phones. I can run tests against the hub and it will run them on the devices connected to the node. If I look at the node's dashboard the session exists and is being captured as expected but none of that information is sent to the hub. The hub does recognize if a device is busy and in the logs it recognizes that sessions are being created.
Command to run the hub and node are both the same currently:
appium server -ka 800 --use-plugins=device-farm,appium-dashboard --allow-cors --relaxed-security --config hub-config.json -pa /wd/hub
Only difference in the above between the hub and node is the config used which are just the example configurations from the wiki. Is there a configuration step I am missing to get the sessions to appear on the hub for inspection?
hub-config.json:
node-config.json