@e2e-dev/limrun 0.2.5-nightly-20261110030217 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/.build.json +1 -1
- package/dist/driver.d.ts +3 -2
- package/dist/driver.js +4 -5
- package/dist/heartbeat.js +5 -4
- package/dist/session.d.ts +6 -0
- package/dist/session.js +9 -0
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -13,6 +13,5 @@ const engine = mobile({ platform: 'ios', device: limrun() });
|
|
|
13
13
|
Set `LIMRUN_API_KEY` in the run environment and install `@limrun/api`.
|
|
14
14
|
Android also requires `adb` on `PATH` for the driver's tunnel.
|
|
15
15
|
|
|
16
|
-
See the [integration guide](https://e2e.com/docs/integrations/limrun)
|
|
17
|
-
|
|
18
|
-
that run unchanged on both platforms.
|
|
16
|
+
See the [integration guide](https://e2e.com/docs/integrations/limrun) for setup.
|
|
17
|
+
Find partner examples in [Community packages](https://e2e.com/docs/community-packages#find-related-integrations).
|
package/dist/.build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.2.5
|
|
1
|
+
{"version":"0.2.5"}
|
package/dist/driver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DeviceClientConfig } from '@e2e-dev/mobile';
|
|
2
2
|
/** A separate process gives each daemon its own credentials without changing the runner's environment. */
|
|
3
3
|
export interface DriverRequest {
|
|
4
4
|
stateDir: string;
|
|
@@ -9,7 +9,8 @@ export interface DriverRequest {
|
|
|
9
9
|
appPath?: string | undefined;
|
|
10
10
|
}
|
|
11
11
|
export interface DriverBinding {
|
|
12
|
-
client
|
|
12
|
+
/** The lease scope the engine creates its client with. No `session`: the engine rejects a lease that names one. */
|
|
13
|
+
client: DeviceClientConfig;
|
|
13
14
|
deviceId: string;
|
|
14
15
|
installedApp?: string;
|
|
15
16
|
}
|
package/dist/driver.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
1
|
import { createAgentDeviceClient } from 'agent-device';
|
|
2
|
+
import { leaseSession } from './session.js';
|
|
3
3
|
process.once('message', (request) => {
|
|
4
4
|
void attach(request).then((binding) => process.send?.({ binding }, () => process.disconnect?.()), (cause) => process.send?.({ error: cause instanceof Error ? cause.message : String(cause) }, () => process.disconnect?.()));
|
|
5
5
|
});
|
|
6
6
|
async function attach(request) {
|
|
7
7
|
const { stateDir, runId, slot, platform, app, appPath } = request;
|
|
8
|
-
|
|
9
|
-
const session = `e2e-lease-${createHash('sha256').update(stateDir).digest('hex').slice(0, 8)}`;
|
|
8
|
+
const session = leaseSession(stateDir);
|
|
10
9
|
const allocator = createAgentDeviceClient({ stateDir, session });
|
|
11
10
|
const lease = await allocator.leases.allocate({
|
|
12
11
|
tenant: 'e2e', runId, clientId: `worker-${slot}`, leaseBackend: `${platform}-instance`, leaseProvider: 'limrun', retainOnClose: true,
|
|
@@ -14,14 +13,14 @@ async function attach(request) {
|
|
|
14
13
|
if (!lease.retainOnClose)
|
|
15
14
|
throw new Error('agent-device did not retain the Limrun lease across session close');
|
|
16
15
|
const client = {
|
|
17
|
-
stateDir,
|
|
16
|
+
stateDir, tenant: lease.tenantId, runId: lease.runId, leaseId: lease.leaseId,
|
|
18
17
|
leaseBackend: lease.backend, leaseProvider: 'limrun',
|
|
19
18
|
...(lease.deviceKey === undefined ? {} : { deviceKey: lease.deviceKey }),
|
|
20
19
|
...(lease.clientId === undefined ? {} : { clientId: lease.clientId }),
|
|
21
20
|
};
|
|
22
21
|
const binding = { client, deviceId: `limrun:${platform}:${lease.leaseId}` };
|
|
23
22
|
if (appPath !== undefined) {
|
|
24
|
-
const device = createAgentDeviceClient(client);
|
|
23
|
+
const device = createAgentDeviceClient({ ...client, session });
|
|
25
24
|
const installed = await device.apps.install({ appPath, ...(platform === 'ios' ? { udid: binding.deviceId } : { serial: binding.deviceId }), ...(app === undefined ? {} : { app }), platform });
|
|
26
25
|
const id = installed.appId ?? installed.bundleId ?? installed.package ?? app;
|
|
27
26
|
if (!id)
|
package/dist/heartbeat.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createAgentDeviceClient } from 'agent-device';
|
|
2
|
+
import { leaseSession } from './session.js';
|
|
2
3
|
/** Renew idle leases while other targets run; session retention alone does not prevent expiry. */
|
|
3
4
|
export async function startHeartbeat(binding, log) {
|
|
5
|
+
const { stateDir, leaseId } = binding.client;
|
|
6
|
+
if (!stateDir || !leaseId)
|
|
7
|
+
throw new Error('Limrun driver returned no agent-device state directory or lease id');
|
|
4
8
|
// An explicit empty URL selects the local stateDir instead of an ambient remote daemon.
|
|
5
|
-
const client = createAgentDeviceClient({ ...binding.client, daemonBaseUrl: '', daemonAuthToken: '', daemonTransport: 'auto' });
|
|
6
|
-
const leaseId = binding.client.leaseId;
|
|
7
|
-
if (!leaseId)
|
|
8
|
-
throw new Error('Limrun driver returned no agent-device lease id');
|
|
9
|
+
const client = createAgentDeviceClient({ ...binding.client, session: leaseSession(stateDir), daemonBaseUrl: '', daemonAuthToken: '', daemonTransport: 'auto' });
|
|
9
10
|
const controller = new AbortController();
|
|
10
11
|
const beat = () => client.leases.heartbeat({ leaseId, ttlMs: 60_000, signal: AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]) });
|
|
11
12
|
await beat();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session the driver allocates a lease under and the heartbeat renews it under. agent-device
|
|
3
|
+
* refuses a provider lease to a client that names no session, and the daemon in `stateDir` holds
|
|
4
|
+
* one lease. The lease the engine receives never carries it: the engine names its own session.
|
|
5
|
+
*/
|
|
6
|
+
export declare function leaseSession(stateDir: string): string;
|
package/dist/session.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* The session the driver allocates a lease under and the heartbeat renews it under. agent-device
|
|
4
|
+
* refuses a provider lease to a client that names no session, and the daemon in `stateDir` holds
|
|
5
|
+
* one lease. The lease the engine receives never carries it: the engine names its own session.
|
|
6
|
+
*/
|
|
7
|
+
export function leaseSession(stateDir) {
|
|
8
|
+
return `e2e-lease-${createHash('sha256').update(stateDir).digest('hex').slice(0, 8)}`;
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e2e-dev/limrun",
|
|
3
|
-
"version": "0.2.5
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Limrun hosted iOS simulators and Android emulators for e2e mobile tests",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"e2e",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
],
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/
|
|
19
|
+
"url": "git+https://github.com/e2e-inc/e2e.git",
|
|
20
20
|
"directory": "packages/limrun"
|
|
21
21
|
},
|
|
22
22
|
"bugs": {
|
|
23
|
-
"url": "https://github.com/
|
|
23
|
+
"url": "https://github.com/e2e-inc/e2e/issues"
|
|
24
24
|
},
|
|
25
|
-
"homepage": "https://github.com/
|
|
25
|
+
"homepage": "https://github.com/e2e-inc/e2e/tree/main/packages/limrun#readme",
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"registry": "https://registry.npmjs.org/",
|
|
28
28
|
"access": "public",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"NOTICE"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@e2e-dev/mobile": "0.
|
|
43
|
+
"@e2e-dev/mobile": ">=0.11.1 <1",
|
|
44
44
|
"@limrun/api": ">=0.59.0 <1",
|
|
45
|
-
"e2e": "0.
|
|
45
|
+
"e2e": ">=0.15.0 <1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@e2e-dev/mobile": "0.12.7
|
|
49
|
-
"@limrun/api": "0.
|
|
48
|
+
"@e2e-dev/mobile": "0.12.7",
|
|
49
|
+
"@limrun/api": "0.71.1",
|
|
50
50
|
"@types/node": "26.6.6",
|
|
51
|
-
"e2e": "0.23.1
|
|
51
|
+
"e2e": "0.23.1",
|
|
52
52
|
"typescript": "7.0.2",
|
|
53
53
|
"vitest": "5.1.0"
|
|
54
54
|
},
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"node": "^22.22.3 || >=24.8.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"agent-device": "0.21.
|
|
59
|
+
"agent-device": "0.21.37"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc --project tsconfig.build.json && node ../../scripts/stamp-dist.ts",
|