Fix startLogging / stopLogging for ArchivedDevice
Summary: Unit test would fail on trying to emit server commands when creating a ArchivedDevice. But archived devices can silently ignore log start commands, which fixes the failing test as well. Example failing run: https://github.com/facebook/flipper/runs/3685776120 I'm not sure why the test wasn't _always_ failing Reviewed By: lblasa Differential Revision: D31142584 fbshipit-source-id: 57106ecdace9f72444eaf68ee9fa024c84556a1c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
987755bb09
commit
b539f4d870
@@ -68,4 +68,18 @@ export default class ArchivedDevice extends BaseDevice {
|
|||||||
getArchivedScreenshotHandle(): string | null {
|
getArchivedScreenshotHandle(): string | null {
|
||||||
return this.archivedScreenshotHandle;
|
return this.archivedScreenshotHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
async startLogging() {
|
||||||
|
// No-op
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
async stopLogging() {
|
||||||
|
// No-op
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import {
|
|||||||
PluginClient,
|
PluginClient,
|
||||||
DevicePluginClient,
|
DevicePluginClient,
|
||||||
sleep,
|
sleep,
|
||||||
|
Device,
|
||||||
} from 'flipper-plugin';
|
} from 'flipper-plugin';
|
||||||
import {selectPlugin} from '../../reducers/connections';
|
import {selectPlugin} from '../../reducers/connections';
|
||||||
import {TestIdler} from '../Idler';
|
import {TestIdler} from '../Idler';
|
||||||
@@ -71,7 +72,7 @@ function generateNotifications(
|
|||||||
return {id, title, message, severity};
|
return {id, title, message, severity};
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateClientIdentifier(device: TestDevice, app: string): string {
|
function generateClientIdentifier(device: Device, app: string): string {
|
||||||
const {os, deviceType, serial} = device;
|
const {os, deviceType, serial} = device;
|
||||||
const identifier = `${app}#${os}#${deviceType}#${serial}`;
|
const identifier = `${app}#${os}#${deviceType}#${serial}`;
|
||||||
return identifier;
|
return identifier;
|
||||||
@@ -97,10 +98,8 @@ function generateClientFromClientWithSalt(
|
|||||||
query: {app, os, device, device_id: salt + '-' + device_id},
|
query: {app, os, device, device_id: salt + '-' + device_id},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function generateClientFromDevice(
|
|
||||||
device: TestDevice,
|
function generateClientFromDevice(device: Device, app: string): ClientExport {
|
||||||
app: string,
|
|
||||||
): ClientExport {
|
|
||||||
const {os, deviceType, serial} = device;
|
const {os, deviceType, serial} = device;
|
||||||
const identifier = generateClientIdentifier(device, app);
|
const identifier = generateClientIdentifier(device, app);
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user